Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit e64aca3

Browse files
author
malayeri
committed
Added a callback to Global.Run for fine-grain progress reporting, to used by e.g., the Eclipse plugin.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24433 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent befa5d1 commit e64aca3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,11 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
320320

321321
val unit0 = currentRun.currentUnit
322322
try {
323-
currentRun.currentUnit = unit
324-
if (!cancelled(unit))
323+
currentRun.currentUnit = unit
324+
if (!cancelled(unit)) {
325+
currentRun.informUnitStarting(this, unit)
325326
reporter.withSource(unit.source) { apply(unit) }
327+
}
326328
currentRun.advanceUnit
327329
} finally {
328330
//assert(currentRun.currentUnit == unit)
@@ -714,6 +716,12 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
714716
*/
715717
def progress(current: Int, total: Int) {}
716718

719+
/**
720+
* For subclasses to override. Called when `phase` is about to be run on `unit`.
721+
* Variables are passed explicitly to indicate that `globalPhase` and `currentUnit` have been set.
722+
*/
723+
def informUnitStarting(phase: Phase, unit: CompilationUnit) { }
724+
717725
/** take note that phase is completed
718726
* (for progress reporting)
719727
*/

0 commit comments

Comments
 (0)