--- a/SmallSense__JavaCompletionEngine.st Wed Apr 06 04:49:57 2016 +0100
+++ b/SmallSense__JavaCompletionEngine.st Fri Apr 08 10:32:21 2016 +0100
@@ -181,7 +181,17 @@
^ result
].
searcher := JAVA org eclipse jdt core dom NodeSearcher new: position - 1"Java is 0-based" - 1"cursor is actualy one fter the end of token".
- tree traverse: searcher _: tree scope.
+ "/ Used to be
+ "/
+ "/ tree traverse: searcher _: tree scope.
+ "/
+ "/ But when a scope is nil, then there are two matching methods
+ "/ (traverse(...,CompilationUnitScope) and
+ "/ (traverse(...,BlockScope).
+ "/ Use perform to explicitly select the correct one.
+ tree perform: #'traverse(Lorg/eclipse/jdt/internal/compiler/ASTVisitor;Lorg/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope;)V'
+ with: searcher
+ with: tree scope.
(searcher found notNil and:[searcher found isKindOf: JAVA org eclipse jdt internal compiler ast AbstractMethodDeclaration]) ifTrue:[
parser parseBlockStatements: searcher found _: tree.
].
@@ -210,7 +220,7 @@
^ result
"Created: / 02-10-2013 / 13:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (comment): / 27-03-2015 / 18:09:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 08-04-2016 / 09:25:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaCompletionEngine class methodsFor:'documentation'!