| 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/src/services/correction/namespace.dart'; | 9 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 10 import 'package:analysis_server/src/services/index/index.dart'; | 10 import 'package:analysis_server/src/services/index/index.dart'; |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 | 740 |
| 741 /** | 741 /** |
| 742 * Records the [Element] definition in the library and universe. | 742 * Records the [Element] definition in the library and universe. |
| 743 */ | 743 */ |
| 744 void _recordTopLevelElementDefinition(Element element) { | 744 void _recordTopLevelElementDefinition(Element element) { |
| 745 Location location = createLocation(element); | 745 Location location = createLocation(element); |
| 746 recordRelationship(_libraryElement, IndexConstants.DEFINES, location); | 746 recordRelationship(_libraryElement, IndexConstants.DEFINES, location); |
| 747 _store.recordTopDeclaration(element); | 747 _store.recordTopLevelDeclaration(element); |
| 748 } | 748 } |
| 749 | 749 |
| 750 /** | 750 /** |
| 751 * Creates a [Location] representing declaration of the [Element]. | 751 * Creates a [Location] representing declaration of the [Element]. |
| 752 */ | 752 */ |
| 753 static Location createLocation(Element element) { | 753 static Location createLocation(Element element) { |
| 754 if (element != null) { | 754 if (element != null) { |
| 755 int offset = element.nameOffset; | 755 int offset = element.nameOffset; |
| 756 int length = element.displayName.length; | 756 int length = element.displayName.length; |
| 757 return new Location(element, offset, length); | 757 return new Location(element, offset, length); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 782 } | 782 } |
| 783 | 783 |
| 784 /** | 784 /** |
| 785 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". | 785 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". |
| 786 */ | 786 */ |
| 787 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { | 787 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { |
| 788 AstNode parent = node.parent; | 788 AstNode parent = node.parent; |
| 789 return parent is PrefixedIdentifier && parent.identifier == node; | 789 return parent is PrefixedIdentifier && parent.identifier == node; |
| 790 } | 790 } |
| 791 } | 791 } |
| OLD | NEW |