diff options
author | Donna Malayeri <lindydonna@gmail.com> | 2011-03-11 15:54:57 +0000 |
---|---|---|
committer | Donna Malayeri <lindydonna@gmail.com> | 2011-03-11 15:54:57 +0000 |
commit | 8f245d95f683dec681ea98406c438da32409c088 (patch) | |
tree | a62f33f1c8c78fefbc96e15e5b8b481dcb73b0c8 | |
parent | be49752855a1a6997d4112eeff351e1c119a8a93 (diff) | |
download | scala-8f245d95f683dec681ea98406c438da32409c088.tar.gz scala-8f245d95f683dec681ea98406c438da32409c088.tar.bz2 scala-8f245d95f683dec681ea98406c438da32409c088.zip |
Added a callback to Global.Run for fine-grain p...
Added a callback to Global.Run for fine-grain progress reporting, to
used by e.g., the Eclipse plugin.
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index c899e25302..5fd5538660 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -321,8 +321,10 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable val unit0 = currentRun.currentUnit try { currentRun.currentUnit = unit - if (!cancelled(unit)) + if (!cancelled(unit)) { + currentRun.informUnitStarting(this, unit) reporter.withSource(unit.source) { apply(unit) } + } currentRun.advanceUnit } finally { //assert(currentRun.currentUnit == unit) @@ -714,6 +716,12 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable */ def progress(current: Int, total: Int) {} + /** + * For subclasses to override. Called when `phase` is about to be run on `unit`. + * Variables are passed explicitly to indicate that `globalPhase` and `currentUnit` have been set. + */ + def informUnitStarting(phase: Phase, unit: CompilationUnit) { } + /** take note that phase is completed * (for progress reporting) */ |