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

Unified Diff: pkg/analysis_server/test/services/completion/imported_computer_test.dart

Issue 787663004: cache suggestions on change in priority sources (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years 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/completion/imported_computer.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/completion/imported_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/imported_computer_test.dart b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
index 7f7ed1b8a03c303a6afa7949d32f280e0b30304c..bec1272875a751f6bda2402fcb7b0db1f3176e09 100644
--- a/pkg/analysis_server/test/services/completion/imported_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_computer_test.dart
@@ -39,6 +39,9 @@ class ImportedComputerTest extends AbstractSelectorSuggestionTest {
*/
@override
void assertCachedCompute(_) {
+ if (!(computer as ImportedComputer).shouldWaitForLowPrioritySuggestions) {
+ return;
+ }
expect(request.unit.element, isNotNull);
List<CompletionSuggestion> oldSuggestions = request.suggestions;
/*
@@ -144,4 +147,44 @@ class ImportedComputerTest extends AbstractSelectorSuggestionTest {
assertNotCached('m1');
});
}
+
+ test_Block_partial_results() {
+ // Block BlockFunctionBody MethodDeclaration
+ addSource('/testAB.dart', '''
+ export "dart:math" hide max;
+ class A {int x;}
+ @deprecated D1() {int x;}
+ class _B { }''');
+ addSource('/testCD.dart', '''
+ String T1;
+ var _T2;
+ class C { }
+ class D { }''');
+ addSource('/testEEF.dart', '''
+ class EE { }
+ class F { }''');
+ addSource('/testG.dart', 'class G { }');
+ addSource('/testH.dart', '''
+ class H { }
+ int T3;
+ var _T4;'''); // not imported
+ addTestSource('''
+ import "/testAB.dart";
+ import "/testCD.dart" hide D;
+ import "/testEEF.dart" show EE;
+ import "/testG.dart" as g;
+ int T5;
+ var _T6;
+ Z D2() {int x;}
+ class X {a() {var f; {var x;} ^ var r;} void b() { }}
+ class Z { }''');
+ (computer as ImportedComputer).shouldWaitForLowPrioritySuggestions = false;
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggestImportedClass('C');
+ // Assert computer does not wait for or include low priority results
+ // from non-imported libraries unless instructed to do so.
+ assertNotSuggested('H');
+ });
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/imported_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698