summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDonna Malayeri <lindydonna@gmail.com>2011-03-11 15:54:57 +0000
committerDonna Malayeri <lindydonna@gmail.com>2011-03-11 15:54:57 +0000
commit8f245d95f683dec681ea98406c438da32409c088 (patch)
treea62f33f1c8c78fefbc96e15e5b8b481dcb73b0c8 /src
parentbe49752855a1a6997d4112eeff351e1c119a8a93 (diff)
downloadscala-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.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala10
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)
*/