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

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

Issue 1095113004: include importUri in out of scope suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.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_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 35113b47741bd0dbe5c0890135b0b9f54f219740..03bb6e7226c4c2810d57956e27d0968f04618ab1 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
@@ -117,42 +117,76 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
}
@override
+ CompletionSuggestion assertSuggestImportedClass(String name,
+ {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
+ int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ return assertSuggestClass(name,
+ relevance: relevance, kind: kind, importUri: importUri);
+ }
+
+ @override
CompletionSuggestion assertSuggestImportedConstructor(String name,
- {int relevance: DART_RELEVANCE_DEFAULT}) {
- return assertSuggestConstructor(name, relevance: relevance);
+ {int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {
+ return assertSuggestConstructor(name,
+ relevance: relevance, importUri: importUri);
}
@override
CompletionSuggestion assertSuggestImportedField(String name, String type,
- {int relevance: DART_RELEVANCE_INHERITED_FIELD}) {
- return assertSuggestField(name, type, relevance: relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_FIELD, String importUri}) {
+ return assertSuggestField(name, type,
+ relevance: relevance, importUri: importUri);
}
@override
CompletionSuggestion assertSuggestImportedFunction(
String name, String returnType,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT}) {
+ bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+ String importUri}) {
return assertSuggestFunction(name, returnType,
- kind: kind, deprecated: deprecated, relevance: relevance);
+ kind: kind,
+ deprecated: deprecated,
+ relevance: relevance,
+ importUri: importUri);
+ }
+
+ @override
+ CompletionSuggestion assertSuggestImportedFunctionTypeAlias(
+ String name, String returnType, [bool isDeprecated = false,
+ int relevance = DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ return assertSuggestFunctionTypeAlias(
+ name, returnType, isDeprecated, relevance, kind, importUri);
}
CompletionSuggestion assertSuggestImportedGetter(
String name, String returnType,
- {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR}) {
- return assertSuggestGetter(name, returnType, relevance: relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR, String importUri}) {
+ return assertSuggestGetter(name, returnType,
+ relevance: relevance, importUri: importUri);
}
CompletionSuggestion assertSuggestImportedMethod(
String name, String declaringType, String returnType,
- {int relevance: DART_RELEVANCE_INHERITED_METHOD}) {
+ {int relevance: DART_RELEVANCE_INHERITED_METHOD, String importUri}) {
return assertSuggestMethod(name, declaringType, returnType,
- relevance: relevance);
+ relevance: relevance, importUri: importUri);
}
CompletionSuggestion assertSuggestImportedSetter(String name,
- {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR}) {
- return assertSuggestSetter(name, relevance);
+ {int relevance: DART_RELEVANCE_INHERITED_ACCESSOR, String importUri}) {
+ return assertSuggestSetter(name, relevance, importUri);
+ }
+
+ @override
+ CompletionSuggestion assertSuggestImportedTopLevelVar(
+ String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
+ CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
+ String importUri]) {
+ return assertSuggestTopLevelVar(
+ name, returnType, relevance, kind, importUri);
}
@override
@@ -226,17 +260,6 @@ 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', '''
@@ -458,6 +481,18 @@ main() {new ^ String x = "hello";}''');
});
}
+ test_internal_sdk_libs() {
+ addTestSource('main() {p^}');
+ computeFast();
+ return computeFull((bool result) {
+ assertSuggest('print');
+ assertSuggest('pow',
+ relevance: DART_RELEVANCE_LOW, importUri: 'dart:math');
+ // Do not suggest completions from internal SDK library
+ assertNotSuggested('printToConsole');
+ });
+ }
+
test_method_parameters_mixed_required_and_named() {
addSource('/libA.dart', '''
class A {
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698