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

Unified Diff: pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart

Issue 1405033002: Issue 24599. Fix for requesting navigation for directives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
index 7f58ad77b31aafeae1efd4d3902de874e27f31f6..a4971ce51f03efcb9a1f2202dc668d0bf57c38f0 100644
--- a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
@@ -58,8 +58,7 @@ class _DartNavigationCollector {
if (element.location == null) {
return;
}
- protocol.ElementKind kind =
- protocol.convertElementKind(element.kind);
+ protocol.ElementKind kind = protocol.convertElementKind(element.kind);
protocol.Location location = protocol.newLocation_fromElement(element);
if (location == null) {
return;
@@ -326,9 +325,11 @@ class _DartRangeAstVisitor extends UnifyingAstVisitor {
return;
}
// The node starts or ends in the range.
- if (isInRange(node.offset) || isInRange(node.end)) {
- node.accept(visitor);
- return;
+ if (node is! CompilationUnit) {
+ if (isInRange(node.offset) || isInRange(node.end) || node is Directive) {
+ node.accept(visitor);
+ return;
+ }
}
// Go deeper.
super.visitNode(node);
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698