| 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/analysis/index_core.dart'; | 9 import 'package:analysis_server/analysis/index_core.dart'; |
| 10 import 'package:analysis_server/src/services/correction/namespace.dart'; | 10 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 771 } |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 /** | 775 /** |
| 776 * Records the [Element] definition in the library and universe. | 776 * Records the [Element] definition in the library and universe. |
| 777 */ | 777 */ |
| 778 void _recordTopLevelElementDefinition(Element element) { | 778 void _recordTopLevelElementDefinition(Element element) { |
| 779 if (element != null) { | 779 if (element != null) { |
| 780 IndexableElement indexable = new IndexableElement(element); | 780 IndexableElement indexable = new IndexableElement(element); |
| 781 int offset = indexable.offset; | 781 int offset = element.nameOffset; |
| 782 int length = indexable.length; | 782 int length = element.nameLength; |
| 783 LocationImpl location = new LocationImpl(indexable, offset, length); | 783 LocationImpl location = new LocationImpl(indexable, offset, length); |
| 784 recordRelationshipElement( | 784 recordRelationshipElement( |
| 785 _libraryElement, IndexConstants.DEFINES, location); | 785 _libraryElement, IndexConstants.DEFINES, location); |
| 786 _store.recordTopLevelDeclaration(element); | 786 _store.recordTopLevelDeclaration(element); |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 | 789 |
| 790 /** | 790 /** |
| 791 * If the given expression has resolved type, returns the new location with th
is type. | 791 * If the given expression has resolved type, returns the new location with th
is type. |
| 792 * | 792 * |
| (...skipping 17 matching lines...) Expand all Loading... |
| 810 } | 810 } |
| 811 | 811 |
| 812 /** | 812 /** |
| 813 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". | 813 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node
". |
| 814 */ | 814 */ |
| 815 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { | 815 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { |
| 816 AstNode parent = node.parent; | 816 AstNode parent = node.parent; |
| 817 return parent is PrefixedIdentifier && parent.identifier == node; | 817 return parent is PrefixedIdentifier && parent.identifier == node; |
| 818 } | 818 } |
| 819 } | 819 } |
| OLD | NEW |