| Index: pkg/analysis_server/test/services/index/index_test.dart
|
| diff --git a/pkg/analysis_server/test/services/index/index_test.dart b/pkg/analysis_server/test/services/index/index_test.dart
|
| index a99d34aba8069db5845a5ff29b8373ce3311ab08..5a1f093f61d9c8b000c367adbe71909ffcee2388 100644
|
| --- a/pkg/analysis_server/test/services/index/index_test.dart
|
| +++ b/pkg/analysis_server/test/services/index/index_test.dart
|
| @@ -248,6 +248,28 @@ class A {
|
| findLocationTest(locations, 'test();', false);
|
| }
|
|
|
| + test_indexDeclarations_afterIndexUnit() async {
|
| + resolveTestUnit('''
|
| +var a = 0;
|
| +var b = a + 1;
|
| +''');
|
| + index.indexUnit(testUnit);
|
| + TopLevelVariableElement a = findElement('a');
|
| + // We can find references.
|
| + {
|
| + List<Location> locations = await index.getRelations(
|
| + a.getter, IndexRelationKind.IS_REFERENCED_BY);
|
| + findLocationTest(locations, 'a + 1', false);
|
| + }
|
| + // Attempt to index just declarations - we still can find references.
|
| + index.indexDeclarations(testUnit);
|
| + {
|
| + List<Location> locations = await index.getRelations(
|
| + a.getter, IndexRelationKind.IS_REFERENCED_BY);
|
| + findLocationTest(locations, 'a + 1', false);
|
| + }
|
| + }
|
| +
|
| test_indexDeclarations_nullUnit() async {
|
| index.indexDeclarations(null);
|
| }
|
|
|