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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.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/dom/NodeFinder.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.java
index a14355c75d2033ca46f6dd482b4b17d09251e329..afc8b90da4cdc8f20c8dc70f65c3baa0ee9ec287 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.java
@@ -15,6 +15,8 @@ package com.google.dart.tools.core.dom;
import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartClass;
+import com.google.dart.compiler.ast.DartComment;
+import com.google.dart.compiler.ast.DartDeclaration;
import com.google.dart.compiler.ast.DartExpression;
import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFunction;
@@ -189,7 +191,8 @@ public class NodeFinder extends ASTVisitor<Void> {
@Override
public Void visitClass(DartClass node) {
classDef = node;
- visitNode(node);
+ super.visitClass(node);
+// visitNode(node);
classDef = null;
return null;
}
@@ -215,9 +218,12 @@ public class NodeFinder extends ASTVisitor<Void> {
int nodeStart = node.getSourceInfo().getOffset();
int nodeEnd = node.getSourceInfo().getEnd();
if (nodeEnd < fStart || fEnd < nodeStart) {
- if (nodeEnd == -2) {
- // TODO Remove this workaround for a parser bug: no source positions set
- node.visitChildren(this);
+ // we don't include comment into node source range
+ if (node instanceof DartDeclaration<?>) {
+ DartComment comment = ((DartDeclaration<?>) node).getDartDoc();
+ if (comment != null) {
+ visitNode(comment);
+ }
}
return null;
}

Powered by Google App Engine
This is Rietveld 408576698