| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 services.src.index.index_contributor; | 5 library services.src.index.index_contributor; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/index/index_core.dart'; | 9 import 'package:analysis_server/plugin/index/index_core.dart'; |
| 10 import 'package:analysis_server/src/services/correction/namespace.dart'; | 10 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 recordRelationshipIndexable( | 354 recordRelationshipIndexable( |
| 355 new IndexableName(name.name), IndexConstants.IS_INVOKED_BY, location); | 355 new IndexableName(name.name), IndexConstants.IS_INVOKED_BY, location); |
| 356 // element invocation | 356 // element invocation |
| 357 Element element = name.bestElement; | 357 Element element = name.bestElement; |
| 358 if (element is MethodElement || | 358 if (element is MethodElement || |
| 359 element is PropertyAccessorElement || | 359 element is PropertyAccessorElement || |
| 360 element is FunctionElement || | 360 element is FunctionElement || |
| 361 element is VariableElement) { | 361 element is VariableElement) { |
| 362 recordRelationshipElement( | 362 recordRelationshipElement( |
| 363 element, IndexConstants.IS_INVOKED_BY, location); | 363 element, IndexConstants.IS_INVOKED_BY, location); |
| 364 } else if (element is ClassElement) { |
| 365 recordRelationshipElement( |
| 366 element, IndexConstants.IS_REFERENCED_BY, location); |
| 364 } | 367 } |
| 365 _recordImportElementReferenceWithoutPrefix(name); | 368 _recordImportElementReferenceWithoutPrefix(name); |
| 366 super.visitMethodInvocation(node); | 369 super.visitMethodInvocation(node); |
| 367 } | 370 } |
| 368 | 371 |
| 369 @override | 372 @override |
| 370 visitPartDirective(PartDirective node) { | 373 visitPartDirective(PartDirective node) { |
| 371 Element element = node.element; | 374 Element element = node.element; |
| 372 LocationImpl location = _createLocationForNode(node.uri); | 375 LocationImpl location = _createLocationForNode(node.uri); |
| 373 recordRelationshipElement( | 376 recordRelationshipElement( |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 } | 813 } |
| 811 | 814 |
| 812 /** | 815 /** |
| 813 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". | 816 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". |
| 814 */ | 817 */ |
| 815 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { | 818 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { |
| 816 AstNode parent = node.parent; | 819 AstNode parent = node.parent; |
| 817 return parent is PrefixedIdentifier && parent.identifier == node; | 820 return parent is PrefixedIdentifier && parent.identifier == node; |
| 818 } | 821 } |
| 819 } | 822 } |
| OLD | NEW |