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/index_core.dart'; | 7 import 'package:analysis_server/analysis/index/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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 List<RecordedRelation> recordedRelations = <RecordedRelation>[]; | 62 List<RecordedRelation> recordedRelations = <RecordedRelation>[]; |
63 List<Element> recordedTopElements = <Element>[]; | 63 List<Element> recordedTopElements = <Element>[]; |
64 | 64 |
65 CompilationUnitElement importedUnit({int index: 0}) { | 65 CompilationUnitElement importedUnit({int index: 0}) { |
66 List<ImportElement> imports = testLibraryElement.imports; | 66 List<ImportElement> imports = testLibraryElement.imports; |
67 return imports[index].importedLibrary.definingCompilationUnit; | 67 return imports[index].importedLibrary.definingCompilationUnit; |
68 } | 68 } |
69 | 69 |
70 void setUp() { | 70 void setUp() { |
71 super.setUp(); | 71 super.setUp(); |
72 when(store.aboutToIndexDart(context, anyObject)).thenReturn(true); | 72 when(store.aboutToIndex(context, anyObject)).thenReturn(true); |
73 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke( | 73 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke( |
74 (IndexableObject indexable, RelationshipImpl relationship, | 74 (IndexableObject indexable, RelationshipImpl relationship, |
75 LocationImpl location) { | 75 LocationImpl location) { |
76 recordedRelations | 76 recordedRelations |
77 .add(new RecordedRelation(indexable, relationship, location)); | 77 .add(new RecordedRelation(indexable, relationship, location)); |
78 }); | 78 }); |
79 when(store.recordTopLevelDeclaration(anyObject)) | 79 when(store.recordTopLevelDeclaration(anyObject)) |
80 .thenInvoke((Element element) { | 80 .thenInvoke((Element element) { |
81 recordedTopElements.add(element); | 81 recordedTopElements.add(element); |
82 }); | 82 }); |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 RecordedRelation(this.indexable, this.relationship, this.location); | 1639 RecordedRelation(this.indexable, this.relationship, this.location); |
1640 | 1640 |
1641 @override | 1641 @override |
1642 String toString() { | 1642 String toString() { |
1643 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; ' | 1643 return 'RecordedRelation(indexable=$indexable; relationship=$relationship; ' |
1644 'location=$location; flags=' | 1644 'location=$location; flags=' |
1645 '${location.isQualified ? "Q" : ""}' | 1645 '${location.isQualified ? "Q" : ""}' |
1646 '${location.isResolved ? "R" : ""})'; | 1646 '${location.isResolved ? "R" : ""})'; |
1647 } | 1647 } |
1648 } | 1648 } |
OLD | NEW |