summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2011-10-07 15:04:34 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2011-10-07 15:04:34 +0000
commit7e2d78266f0a677e9e81fa012178811321626736 (patch)
treec043c983a27ce69bc68f23270fe17541eb3a5b8f /src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
parent8a3e7e1d3f9c54fd21ed5292474e1079703940c9 (diff)
downloadscala-7e2d78266f0a677e9e81fa012178811321626736.tar.gz
scala-7e2d78266f0a677e9e81fa012178811321626736.tar.bz2
scala-7e2d78266f0a677e9e81fa012178811321626736.zip
backport of 25800,25801
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/CompilerControl.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/CompilerControl.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
index 7b84901604..b466cfe2db 100644
--- a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
+++ b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
@@ -187,11 +187,12 @@ trait CompilerControl { self: Global =>
/** If source if not yet loaded, get an outline view with askParseEntered.
* If source is loaded, wait for it to be typechecked.
* In both cases, set response to parsed (and possibly typechecked) tree.
+ * @param keepSrcLoaded If set to `true`, source file will be kept as a loaded unit afterwards.
*/
- def askStructure(source: SourceFile, response: Response[Tree]) = {
+ def askStructure(keepSrcLoaded: Boolean)(source: SourceFile, response: Response[Tree]) = {
getUnit(source) match {
case Some(_) => askLoadedTyped(source, response)
- case None => askParsedEntered(source, false, response)
+ case None => askParsedEntered(source, keepSrcLoaded, response)
}
}