Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java

Issue 10582003: Issue 1355. Support for call(). Tweaks for element locator and rename refactoring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d0a8824e5a7526e344a2a52de31737ea3ebdee75 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,19 @@ public class DartElementLocator extends ASTVisitor<Void> {
return null;
}
+ @Override
+ public Void visitUnqualifiedInvocation(DartUnqualifiedInvocation node) {
+ super.visitUnqualifiedInvocation(node);
+ if (foundElement == null) {
Brian Wilkerson 2012/06/18 20:46:18 This doesn't test to ensure that the node is withi
+ 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.

Powered by Google App Engine
This is Rietveld 408576698