| 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/src/services/index/index.dart'; | 7 import 'package:analysis_server/src/services/index/index.dart'; |
| 8 import 'package:analysis_server/src/services/index/index_contributor.dart'; | 8 import 'package:analysis_server/src/services/index/index_contributor.dart'; |
| 9 import 'package:analysis_server/src/services/index/index_store.dart'; | 9 import 'package:analysis_server/src/services/index/index_store.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 void setUp() { | 65 void setUp() { |
| 66 super.setUp(); | 66 super.setUp(); |
| 67 when(store.aboutToIndexDart(context, anyObject)).thenReturn(true); | 67 when(store.aboutToIndexDart(context, anyObject)).thenReturn(true); |
| 68 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke( | 68 when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke( |
| 69 (Element element, Relationship relationship, Location location) { | 69 (Element element, Relationship relationship, Location location) { |
| 70 recordedRelations | 70 recordedRelations |
| 71 .add(new RecordedRelation(element, relationship, location)); | 71 .add(new RecordedRelation(element, relationship, location)); |
| 72 }); | 72 }); |
| 73 when(store.recordTopDeclaration(anyObject)).thenInvoke((Element element) { | 73 when(store.recordTopLevelDeclaration(anyObject)).thenInvoke((Element element
) { |
| 74 recordedTopElements.add(element); | 74 recordedTopElements.add(element); |
| 75 }); | 75 }); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void test_definesClass() { | 78 void test_definesClass() { |
| 79 _indexTestUnit('class A {}'); | 79 _indexTestUnit('class A {}'); |
| 80 // prepare elements | 80 // prepare elements |
| 81 ClassElement classElement = findElement("A"); | 81 ClassElement classElement = findElement("A"); |
| 82 // verify | 82 // verify |
| 83 _assertDefinesTopLevelElement(classElement); | 83 _assertDefinesTopLevelElement(classElement); |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 | 1477 |
| 1478 RecordedRelation(this.element, this.relationship, this.location); | 1478 RecordedRelation(this.element, this.relationship, this.location); |
| 1479 | 1479 |
| 1480 @override | 1480 @override |
| 1481 String toString() { | 1481 String toString() { |
| 1482 return 'RecordedRelation(element=$element; relationship=$relationship; ' | 1482 return 'RecordedRelation(element=$element; relationship=$relationship; ' |
| 1483 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' | 1483 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' |
| 1484 '${location.isResolved ? "R" : ""})'; | 1484 '${location.isResolved ? "R" : ""})'; |
| 1485 } | 1485 } |
| 1486 } | 1486 } |
| OLD | NEW |