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

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

Issue 11377039: Issue 6251. Resolve and rename type and constructor references in [new Type.name]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 1240c715d46206b6918ed112c5d213a943e1b854..825a1e836c1e8ce9c98146f872b657d790154cd5 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
@@ -18,6 +18,8 @@ import com.google.dart.compiler.ast.ASTNodes;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartArrayAccess;
import com.google.dart.compiler.ast.DartBinaryExpression;
+import com.google.dart.compiler.ast.DartCommentNewName;
+import com.google.dart.compiler.ast.DartCommentRefName;
import com.google.dart.compiler.ast.DartExpression;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartImportDirective;
@@ -275,6 +277,42 @@ public class DartElementLocator extends ASTVisitor<Void> {
}
@Override
+ public Void visitCommentNewName(DartCommentNewName 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);
+ Element targetElement = node.getConstructorElement();
+ if (targetElement != null) {
+ resolvedElement = targetElement;
+ findElementFor(targetElement);
+ }
+ }
+ }
+ return super.visitCommentNewName(node);
+ }
+
+ @Override
+ public Void visitCommentRefName(DartCommentRefName 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);
+ Element targetElement = node.getElement();
+ if (targetElement != null) {
+ resolvedElement = targetElement;
+ findElementFor(targetElement);
+ }
+ }
+ }
+ return super.visitCommentRefName(node);
+ }
+
+ @Override
public Void visitIdentifier(DartIdentifier node) {
if (foundElement == null) {
int start = node.getSourceInfo().getOffset();

Powered by Google App Engine
This is Rietveld 408576698