summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/Global.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-09-29 09:57:49 +0000
committerMartin Odersky <odersky@gmail.com>2010-09-29 09:57:49 +0000
commit521267d23e548ba191028dd7d93d26f803c8fb77 (patch)
tree1f61c9bec4ca922ce1ccd4ea9c4582040b8ba796 /src/compiler/scala/tools/nsc/interactive/Global.scala
parente1eb91714d2129ea460e8c4da4ff65074acb736a (diff)
downloadscala-521267d23e548ba191028dd7d93d26f803c8fb77.tar.gz
scala-521267d23e548ba191028dd7d93d26f803c8fb77.tar.bz2
scala-521267d23e548ba191028dd7d93d26f803c8fb77.zip
Closes #3875. Review by vigdorchick.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 51aaa5125d..5449cb83a5 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -33,7 +33,7 @@ self =>
* All units in firsts are typechecked before any unit not in this list
* Modified by askToDoFirst, reload, typeAtTree.
*/
- var firsts: List[SourceFile] = List()
+ var firsts: Seq[SourceFile] = Seq()
/** A map of all loaded files to the rich compilation units that correspond to them.
*/
@@ -210,9 +210,11 @@ self =>
/** The current presentation compiler runner */
private var compileRunner = newRunnerThread
+ private var threadId = 1
+
/** Create a new presentation compiler runner.
*/
- def newRunnerThread: Thread = new Thread("Scala Presentation Compiler") {
+ def newRunnerThread: Thread = new Thread("Scala Presentation Compiler V"+threadId) {
override def run() {
try {
while (true) {
@@ -240,6 +242,7 @@ self =>
}
}
}
+ threadId += 1
start()
}
@@ -254,7 +257,7 @@ self =>
val prefix = firsts map unitOf
- val units = prefix ::: (unitOfFile.values.toList diff prefix) filter (!_.isUpToDate)
+ val units = prefix ++ (unitOfFile.values.toSeq diff prefix) filter (!_.isUpToDate)
recompile(units)
@@ -285,7 +288,7 @@ self =>
/** Make sure symbol and type attributes are reset and recompile units.
*/
- def recompile(units: List[RichCompilationUnit]) {
+ def recompile(units: Seq[RichCompilationUnit]) {
for (unit <- units) {
reset(unit)
if (debugIDE) inform("parsing: "+unit)
@@ -296,7 +299,7 @@ self =>
activeLocks = 0
currentTyperRun.typeCheck(unit)
unit.status = currentRunId
- syncTopLevelSyms(unit)
+ if (!unit.isJava) syncTopLevelSyms(unit)
}
}
@@ -312,8 +315,8 @@ self =>
}
/** Move list of files to front of firsts */
- def moveToFront(fs: List[SourceFile]) {
- firsts = fs ::: (firsts diff fs)
+ def moveToFront(fs: Seq[SourceFile]) {
+ firsts = fs ++ (firsts diff fs)
}
// ----------------- Implementations of client commands -----------------------
@@ -349,7 +352,7 @@ self =>
}
/** Make sure a set of compilation units is loaded and parsed */
- def reloadSources(sources: List[SourceFile]) {
+ def reloadSources(sources: Seq[SourceFile]) {
currentTyperRun = newTyperRun
for (source <- sources) {
val unit = new RichCompilationUnit(source)
@@ -360,7 +363,7 @@ self =>
}
/** Make sure a set of compilation units is loaded and parsed */
- def reload(sources: List[SourceFile], response: Response[Unit]) {
+ def reload(sources: Seq[SourceFile], response: Response[Unit]) {
respond(response)(reloadSources(sources))
if (outOfDate) throw FreshRunReq // cancel background compile
else outOfDate = true // proceed normally and enable new background compile