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

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

Issue 1064743002: do not suggest elements from internal sdk libs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
Index: pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
index e4e807abb5a42d929bbbd500c1566e27431ad2df..1c622e571af7470bb9dd261765c822c498a6287b 100644
--- a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
@@ -175,7 +175,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
@override
void setUpContributor() {
- contributor = new ImportedReferenceContributor(shouldWaitForLowPrioritySuggestions: true);
+ contributor = new ImportedReferenceContributor(
+ shouldWaitForLowPrioritySuggestions: true);
}
@override
@@ -225,6 +226,17 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
});
}
+ test_internal_sdk_libs() {
+ addTestSource('main() {p^}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggest('print');
+ assertSuggest('pow', relevance: DART_RELEVANCE_LOW);
+ // Do not suggest completions from internal SDK library
+ assertNotSuggested('printToConsole');
+ });
+ }
+
test_Block_partial_results() {
// Block BlockFunctionBody MethodDeclaration
addSource('/testAB.dart', '''
@@ -255,7 +267,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
Z D2() {int x;}
class X {a() {var f; {var x;} ^ var r;} void b() { }}
class Z { }''');
- (contributor as ImportedReferenceContributor).shouldWaitForLowPrioritySuggestions = false;
+ var contributor = this.contributor as ImportedReferenceContributor;
Paul Berry 2015/04/07 01:40:27 IMHO, it's slightly clearer to say: ImportedRef
danrubel 2015/04/07 16:52:26 Done.
+ contributor.shouldWaitForLowPrioritySuggestions = false;
computeFast();
return computeFull((bool result) {
assertSuggestImportedClass('C');

Powered by Google App Engine
This is Rietveld 408576698