diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2011-03-24 17:48:14 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2011-03-24 17:48:14 +0000 |
commit | 3c34549d7dcd91d7a78f7b3bba588369fce5a4a7 (patch) | |
tree | 312e9900788cb0fc777d6597455f86034675d6e8 /src | |
parent | 6b337cb02c6f03d71d7761c807ce5384d7592c15 (diff) | |
download | scala-3c34549d7dcd91d7a78f7b3bba588369fce5a4a7.tar.gz scala-3c34549d7dcd91d7a78f7b3bba588369fce5a4a7.tar.bz2 scala-3c34549d7dcd91d7a78f7b3bba588369fce5a4a7.zip |
Added synchronous version of askStructure, need...
Added synchronous version of askStructure, needed by the IDE to avoid
deadlocks. review by odersky.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 95aec8b0a2..a2426d2212 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -848,6 +848,14 @@ class Global(settings: Settings, reporter: Reporter) } } + /** Synchronous version of askStructure. */ + def getStructure(source: SourceFile, response: Response[Tree]) { + getUnit(source) match { + case Some(_) => waitLoadedTyped(source, response) + case None => getParsedEntered(source, false, response) + } + } + /** Implements CompilerControl.askLoadedTyped */ protected def waitLoadedTyped(source: SourceFile, response: Response[Tree]) { getUnit(source) match { |