Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: pkg/analysis_server/test/services/index/index_test.dart

Issue 1946353004: Issue 26355. Don't overwrite full index with declarations-only one. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/index/index.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « pkg/analysis_server/lib/src/services/index/index.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698