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

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

Issue 1465303003: Generate separate navigation regions for 'super' and optional 'name'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_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 dc4616f086ac09827f01de8f8a70c5235691380b..855330efd8ca5b8ff4b470d51634c4eb6d428685 100644
--- a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
@@ -243,6 +243,19 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
}
@override
+ visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
+ Element element = node.staticElement;
+ if (element != null && element.isSynthetic) {
+ element = element.enclosingElement;
+ }
+ // add region
+ computer._addRegionForToken(node.thisKeyword, element);
+ computer._addRegionForNode(node.constructorName, element);
+ // process arguments
+ _safelyVisit(node.argumentList);
+ }
+
+ @override
visitSimpleIdentifier(SimpleIdentifier node) {
if (node.parent is ConstructorDeclaration) {
return;
@@ -258,12 +271,8 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
element = element.enclosingElement;
}
// add region
- SimpleIdentifier name = node.constructorName;
- if (name != null) {
- computer._addRegion_nodeStart_nodeEnd(node, name, element);
- } else {
- computer._addRegionForToken(node.superKeyword, element);
- }
+ computer._addRegionForToken(node.superKeyword, element);
+ computer._addRegionForNode(node.constructorName, element);
// process arguments
_safelyVisit(node.argumentList);
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_navigation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698