summaryrefslogtreecommitdiff
path: root/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-12-06 12:16:14 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-12-06 12:16:14 +0100
commit2ea8aad5bc63582b563bb999c96e980597a84084 (patch)
treebd1542c3e653ef13304624a23cbc6d1ee1b09633 /src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
parente0c2c14cd80fffa3f8af0836e55a5b8ca8c53d27 (diff)
parent7d4109486b2266f8491d3473f43555dec6e996ee (diff)
downloadscala-2ea8aad5bc63582b563bb999c96e980597a84084.tar.gz
scala-2ea8aad5bc63582b563bb999c96e980597a84084.tar.bz2
scala-2ea8aad5bc63582b563bb999c96e980597a84084.zip
Merge commit '7d41094' into merge/2.10.x-and-pr-3209-to-master
Conflicts: src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
Diffstat (limited to 'src/interactive/scala/tools/nsc/interactive/CompilerControl.scala')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/CompilerControl.scala23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
index 69cae24808..2e4f6b08e9 100644
--- a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
+++ b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
@@ -186,15 +186,20 @@ trait CompilerControl { self: Global =>
postWorkItem(new AskToDoFirstItem(source))
/** If source is not yet loaded, loads it, and starts a new run, otherwise
- * continues with current pass.
- * Waits until source is fully type checked and returns body in response.
- * @param source The source file that needs to be fully typed.
- * @param response The response, which is set to the fully attributed tree of `source`.
+ * continues with current pass.
+ * Waits until source is fully type checked and returns body in response.
+ * @param source The source file that needs to be fully typed.
+ * @param keepLoaded Whether to keep that file in the PC if it was not loaded before. If
+ the file is already loaded, this flag is ignored.
+ * @param response The response, which is set to the fully attributed tree of `source`.
* If the unit corresponding to `source` has been removed in the meantime
* the a NoSuchUnitError is raised in the response.
*/
- def askLoadedTyped(source: SourceFile, response: Response[Tree]) =
- postWorkItem(new AskLoadedTypedItem(source, response))
+ def askLoadedTyped(source:SourceFile, keepLoaded: Boolean, response: Response[Tree]): Unit =
+ postWorkItem(new AskLoadedTypedItem(source, keepLoaded, response))
+
+ final def askLoadedTyped(source: SourceFile, response: Response[Tree]): Unit =
+ askLoadedTyped(source, false, response)
/** If source if not yet loaded, get an outline view with askParseEntered.
* If source is loaded, wait for it to be typechecked.
@@ -203,7 +208,7 @@ trait CompilerControl { self: Global =>
*/
def askStructure(keepSrcLoaded: Boolean)(source: SourceFile, response: Response[Tree]) = {
getUnit(source) match {
- case Some(_) => askLoadedTyped(source, response)
+ case Some(_) => askLoadedTyped(source, keepSrcLoaded, response)
case None => askParsedEntered(source, keepSrcLoaded, response)
}
}
@@ -375,8 +380,8 @@ trait CompilerControl { self: Global =>
response raise new MissingResponse
}
- case class AskLoadedTypedItem(source: SourceFile, response: Response[Tree]) extends WorkItem {
- def apply() = self.waitLoadedTyped(source, response, this.onCompilerThread)
+ case class AskLoadedTypedItem(source: SourceFile, keepLoaded: Boolean, response: Response[Tree]) extends WorkItem {
+ def apply() = self.waitLoadedTyped(source, response, keepLoaded, this.onCompilerThread)
override def toString = "wait loaded & typed "+source
def raiseMissing() =