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

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

Issue 1498163003: Fix for navigation reginos for instance creations with import prefixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library domains.analysis.navigation_dart; 5 library domains.analysis.navigation_dart;
6 6
7 import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart' ; 7 import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart' ;
8 import 'package:analysis_server/src/protocol_server.dart' as protocol; 8 import 'package:analysis_server/src/protocol_server.dart' as protocol;
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 Element element = node.staticElement; 281 Element element = node.staticElement;
282 if (element == null) { 282 if (element == null) {
283 return; 283 return;
284 } 284 }
285 // if a synthetic constructor, navigate to the class 285 // if a synthetic constructor, navigate to the class
286 if (element.isSynthetic) { 286 if (element.isSynthetic) {
287 element = element.enclosingElement; 287 element = element.enclosingElement;
288 } 288 }
289 // add regions 289 // add regions
290 TypeName typeName = node.type; 290 TypeName typeName = node.type;
291 computer._addRegionForNode(typeName.name, element); 291 // [prefix].ClassName
292 {
293 Identifier name = typeName.name;
294 Identifier className = name;
295 if (name is PrefixedIdentifier) {
296 name.prefix.accept(this);
297 className = name.identifier;
298 }
299 computer._addRegionForNode(className, element);
300 }
292 // <TypeA, TypeB> 301 // <TypeA, TypeB>
293 TypeArgumentList typeArguments = typeName.typeArguments; 302 TypeArgumentList typeArguments = typeName.typeArguments;
294 if (typeArguments != null) { 303 if (typeArguments != null) {
295 typeArguments.accept(this); 304 typeArguments.accept(this);
296 } 305 }
297 // optional "name" 306 // optional "name"
298 if (node.name != null) { 307 if (node.name != null) {
299 computer._addRegionForNode(node.name, element); 308 computer._addRegionForNode(node.name, element);
300 } 309 }
301 } 310 }
(...skipping 10 matching lines...) Expand all
312 } 321 }
313 } 322 }
314 } 323 }
315 324
316 void _safelyVisit(AstNode node) { 325 void _safelyVisit(AstNode node) {
317 if (node != null) { 326 if (node != null) {
318 node.accept(this); 327 node.accept(this);
319 } 328 }
320 } 329 }
321 } 330 }
OLDNEW
« 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