Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java |
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java |
index a9a2efb27af7c0fdc7a079ed24931887e9293e5e..2f73f232c1a5e647ebd14b1846693b839a95afab 100644 |
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java |
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java |
@@ -27,9 +27,11 @@ import com.google.dart.compiler.ast.DartResourceDirective; |
import com.google.dart.compiler.ast.DartSourceDirective; |
import com.google.dart.compiler.ast.DartStringLiteral; |
import com.google.dart.compiler.ast.DartUnaryExpression; |
+import com.google.dart.compiler.ast.DartUnqualifiedInvocation; |
import com.google.dart.compiler.resolver.Element; |
import com.google.dart.compiler.resolver.ElementKind; |
import com.google.dart.compiler.resolver.LibraryElement; |
+import com.google.dart.compiler.resolver.NodeElement; |
import com.google.dart.compiler.resolver.VariableElement; |
import com.google.dart.tools.core.DartCore; |
import com.google.dart.tools.core.internal.util.SourceRangeUtils; |
@@ -432,6 +434,25 @@ public class DartElementLocator extends ASTVisitor<Void> { |
return null; |
} |
+ @Override |
+ public Void visitUnqualifiedInvocation(DartUnqualifiedInvocation node) { |
+ super.visitUnqualifiedInvocation(node); |
+ if (foundElement == null) { |
+ int start = node.getSourceInfo().getOffset(); |
+ int length = node.getSourceInfo().getLength(); |
+ int end = start + length; |
+ if (start <= startOffset && endOffset <= end) { |
+ wordRegion = new Region(start, length); |
+ NodeElement invocationElement = node.getElement(); |
+ if (invocationElement != null && node.getTarget() != null |
+ && node.getTarget().getElement() != invocationElement) { |
+ findElementFor(invocationElement); |
+ } |
+ } |
+ } |
+ return null; |
+ } |
+ |
/** |
* Compute a region that represents the portion of the string literal between the opening and |
* closing quotes. |