Skip to content

Commit eba318e

Browse files
author
Antonio Cunei
committed
Merged revisions 24573 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r24573 | dragos | 2011-03-24 18:48:14 +0100 (Thu, 24 Mar 2011) | 1 line Added synchronous version of askStructure, needed by the IDE to avoid deadlocks. review by odersky. ........
1 parent 67b09c4 commit eba318e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,14 @@ class Global(settings: Settings, reporter: Reporter)
848848
}
849849
}
850850

851+
/** Synchronous version of askStructure. */
852+
def getStructure(source: SourceFile, response: Response[Tree]) {
853+
getUnit(source) match {
854+
case Some(_) => waitLoadedTyped(source, response)
855+
case None => getParsedEntered(source, false, response)
856+
}
857+
}
858+
851859
/** Implements CompilerControl.askLoadedTyped */
852860
protected def waitLoadedTyped(source: SourceFile, response: Response[Tree]) {
853861
getUnit(source) match {

0 commit comments

Comments
 (0)