OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |