| 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 test.services.src.index.dart_index_contributor; | 5 library test.services.src.index.dart_index_contributor; |
| 6 | 6 |
| 7 import 'package:analysis_server/analysis/index_core.dart'; | 7 import 'package:analysis_server/analysis/index_core.dart'; |
| 8 import 'package:analysis_server/src/services/index/index.dart'; | 8 import 'package:analysis_server/src/services/index/index.dart'; |
| 9 import 'package:analysis_server/src/services/index/index_contributor.dart'; | 9 import 'package:analysis_server/src/services/index/index_contributor.dart'; |
| 10 import 'package:analysis_server/src/services/index/index_store.dart'; | 10 import 'package:analysis_server/src/services/index/index_store.dart'; |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 indexDartUnit(store, context, null); | 1573 indexDartUnit(store, context, null); |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 void test_nullUnitElement() { | 1576 void test_nullUnitElement() { |
| 1577 CompilationUnit unit = new CompilationUnit(null, null, [], [], null); | 1577 CompilationUnit unit = new CompilationUnit(null, null, [], [], null); |
| 1578 indexDartUnit(store, context, unit); | 1578 indexDartUnit(store, context, unit); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 void _assertDefinesTopLevelElement(Element element) { | 1581 void _assertDefinesTopLevelElement(Element element) { |
| 1582 ExpectedLocation location = new ExpectedLocation( | 1582 ExpectedLocation location = new ExpectedLocation( |
| 1583 element, element.nameOffset, element.name.length, false, true); | 1583 element, element.nameOffset, element.nameLength, false, true); |
| 1584 _assertRecordedRelationForElement( | 1584 _assertRecordedRelationForElement( |
| 1585 testLibraryElement, IndexConstants.DEFINES, location); | 1585 testLibraryElement, IndexConstants.DEFINES, location); |
| 1586 expect(recordedTopElements, contains(element)); | 1586 expect(recordedTopElements, contains(element)); |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 /** | 1589 /** |
| 1590 * Asserts that [recordedRelations] has no item with the specified properties. | 1590 * Asserts that [recordedRelations] has no item with the specified properties. |
| 1591 */ | 1591 */ |
| 1592 void _assertNoRecordedRelation(IndexableObject expectedIndexable, | 1592 void _assertNoRecordedRelation(IndexableObject expectedIndexable, |
| 1593 RelationshipImpl relationship, ExpectedLocation location) { | 1593 RelationshipImpl relationship, ExpectedLocation location) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1723 RecordedRelation(this.indexable, this.relationship, this.location); | 1723 RecordedRelation(this.indexable, this.relationship, this.location); |
| 1724 | 1724 |
| 1725 @override | 1725 @override |
| 1726 String toString() { | 1726 String toString() { |
| 1727 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; ' | 1727 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; ' |
| 1728 'location=$location; flags=' | 1728 'location=$location; flags=' |
| 1729 '${location.isQualified ? "Q" : ""}' | 1729 '${location.isQualified ? "Q" : ""}' |
| 1730 '${location.isResolved ? "R" : ""})'; | 1730 '${location.isResolved ? "R" : ""})'; |
| 1731 } | 1731 } |
| 1732 } | 1732 } |
| OLD | NEW |