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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_navigation.dart

Issue 717513003: Issue 21552. Fixes for navigation, hover and rename in instance creation expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: pkg/analysis_server/lib/src/computer/computer_navigation.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
index faf949d5580092d902701ed99bb625e3e7c1df87..5f87bcc873353ca6b2b098df135240389977fd51 100644
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
@@ -168,20 +168,22 @@ class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor {
ClassElement classElement = element.enclosingElement;
element = classElement;
}
- // "new ", excluding last character
- computer._addRegion_nodeStart_nodeStart(
- node,
- constructorName.type,
- element,
- excludeLastChar: true);
- // "ClassName<TypeA, TypeB>"
- _safelyVisit(constructorName.type);
- // optional ".name"
- if (constructorName.period != null) {
- computer._addRegion_tokenStart_nodeEnd(
- constructorName.period,
- constructorName,
- element);
+ // add regions
+ TypeName typeName = constructorName.type;
+ TypeArgumentList typeArguments = typeName.typeArguments;
+ if (typeArguments == null) {
+ computer._addRegion_nodeStart_nodeEnd(node, constructorName, element);
+ } else {
+ computer._addRegion_nodeStart_nodeEnd(node, typeName.name, element);
+ // <TypeA, TypeB>
+ typeArguments.accept(this);
+ // optional ".name"
+ if (constructorName.period != null) {
+ computer._addRegion_tokenStart_nodeEnd(
+ constructorName.period,
+ constructorName,
+ element);
+ }
}
}
_safelyVisit(node.argumentList);

Powered by Google App Engine
This is Rietveld 408576698