@@ -68,12 +68,8 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
6868 private [this ] var myUnits : List [CompilationUnit ] = _
6969 private [this ] var myUnitsCached : List [CompilationUnit ] = _
7070 private [this ] var myFiles : Set [AbstractFile ] = _
71-
72- /** Units that are added because of source completers but that are not
73- * compiled in current run.
74- */
75- val lateUnits = mutable.ListBuffer [CompilationUnit ]()
76- var lateFiles = mutable.Set [AbstractFile ]()
71+ private [this ] val myLateUnits = mutable.ListBuffer [CompilationUnit ]()
72+ private [this ] var myLateFiles = mutable.Set [AbstractFile ]()
7773
7874 /** The compilation units currently being compiled, this may return different
7975 * results over time.
@@ -95,6 +91,12 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
9591 myFiles
9692 }
9793
94+ /** Units that are added from source completers but that are not compiled in current run. */
95+ def lateUnits : List [CompilationUnit ] = myLateUnits.toList
96+
97+ /** The source files of all late units, as a set */
98+ def lateFiles : collection.Set [AbstractFile ] = myLateFiles
99+
98100 def getSource (fileName : String ): SourceFile = {
99101 val f = new PlainFile (io.Path (fileName))
100102 if (f.isDirectory) {
@@ -184,8 +186,8 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
184186 def enterRoots (file : AbstractFile )(implicit ctx : Context ): Unit =
185187 if (! files.contains(file) && ! lateFiles.contains(file)) {
186188 val unit = new CompilationUnit (getSource(file.path))
187- lateUnits += unit
188- lateFiles += file
189+ myLateUnits += unit
190+ myLateFiles += file
189191 enterRoots(unit)(runContext.fresh.setCompilationUnit(unit))
190192 }
191193
0 commit comments