| Index: pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| index ac44ab74284c5c6d7766331b9a57f743875deb0f..ce6c74eaae2addcba87a2ee2ee4aab033ee11d1a 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| @@ -383,49 +383,49 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| }
|
| }
|
|
|
| - CompletionSuggestion assertSuggestInvocationClass(String name,
|
| - [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
|
| - if (computer is InvocationComputer) {
|
| - return assertSuggestClass(name, relevance);
|
| + CompletionSuggestion assertSuggestImportedTopLevelVar(String name,
|
| + String returnType, [CompletionRelevance relevance =
|
| + CompletionRelevance.DEFAULT]) {
|
| + if (computer is ImportedComputer) {
|
| + return assertSuggestTopLevelVar(name, returnType, relevance);
|
| } else {
|
| return assertNotSuggested(name);
|
| }
|
| }
|
|
|
| - CompletionSuggestion assertSuggestInvocationGetter(String name,
|
| - String returnType, [CompletionRelevance relevance =
|
| + CompletionSuggestion assertSuggestImportedFunction(String name,
|
| + String returnType, [bool isDeprecated = false, CompletionRelevance relevance =
|
| CompletionRelevance.DEFAULT]) {
|
| - if (computer is InvocationComputer) {
|
| - return assertSuggestGetter(name, returnType, relevance);
|
| + if (computer is ImportedComputer) {
|
| + return assertSuggestFunction(name, returnType, isDeprecated, relevance);
|
| } else {
|
| return assertNotSuggested(name);
|
| }
|
| }
|
|
|
| - CompletionSuggestion assertSuggestInvocationTopLevelVar(String name,
|
| - String returnType, [CompletionRelevance relevance =
|
| - CompletionRelevance.DEFAULT]) {
|
| + CompletionSuggestion assertSuggestInvocationClass(String name,
|
| + [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
|
| if (computer is InvocationComputer) {
|
| - return assertSuggestTopLevelVar(name, returnType, relevance);
|
| + return assertSuggestClass(name, relevance);
|
| } else {
|
| return assertNotSuggested(name);
|
| }
|
| }
|
|
|
| - CompletionSuggestion assertSuggestInvocationMethod(String name,
|
| - String declaringType, String returnType, [CompletionRelevance relevance =
|
| + CompletionSuggestion assertSuggestInvocationGetter(String name,
|
| + String returnType, [CompletionRelevance relevance =
|
| CompletionRelevance.DEFAULT]) {
|
| if (computer is InvocationComputer) {
|
| - return assertSuggestMethod(name, declaringType, returnType, relevance);
|
| + return assertSuggestGetter(name, returnType, relevance);
|
| } else {
|
| return assertNotSuggested(name);
|
| }
|
| }
|
|
|
| - CompletionSuggestion assertSuggestLocalMethod(String name,
|
| + CompletionSuggestion assertSuggestInvocationMethod(String name,
|
| String declaringType, String returnType, [CompletionRelevance relevance =
|
| CompletionRelevance.DEFAULT]) {
|
| - if (computer is LocalComputer) {
|
| + if (computer is InvocationComputer) {
|
| return assertSuggestMethod(name, declaringType, returnType, relevance);
|
| } else {
|
| return assertNotSuggested(name);
|
| @@ -441,6 +441,16 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| }
|
| }
|
|
|
| + CompletionSuggestion assertSuggestInvocationTopLevelVar(String name,
|
| + String returnType, [CompletionRelevance relevance =
|
| + CompletionRelevance.DEFAULT]) {
|
| + if (computer is InvocationComputer) {
|
| + return assertSuggestTopLevelVar(name, returnType, relevance);
|
| + } else {
|
| + return assertNotSuggested(name);
|
| + }
|
| + }
|
| +
|
| CompletionSuggestion assertSuggestLocalClass(String name,
|
| [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) {
|
| if (computer is LocalComputer) {
|
| @@ -450,6 +460,16 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| }
|
| }
|
|
|
| + CompletionSuggestion assertSuggestLocalMethod(String name,
|
| + String declaringType, String returnType, [CompletionRelevance relevance =
|
| + CompletionRelevance.DEFAULT]) {
|
| + if (computer is LocalComputer) {
|
| + return assertSuggestMethod(name, declaringType, returnType, relevance);
|
| + } else {
|
| + return assertNotSuggested(name);
|
| + }
|
| + }
|
| +
|
| test_Block() {
|
| // Block BlockFunctionBody MethodDeclaration
|
| addSource('/testAB.dart', '''
|
| @@ -560,6 +580,72 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| + test_Combinator_hide() {
|
| + // SimpleIdentifier HideCombinator ImportDirective
|
| + addSource('/testAB.dart', '''
|
| + library libAB;
|
| + part '/partAB.dart';
|
| + class A { }
|
| + class B { }''');
|
| + addSource('/partAB.dart', '''
|
| + part of libAB;
|
| + var T1;
|
| + PB F1() => new PB();
|
| + class PB { }''');
|
| + addSource('/testCD.dart', '''
|
| + class C { }
|
| + class D { }''');
|
| + addTestSource('''
|
| + import "/testAB.dart" hide ^;
|
| + import "/testCD.dart";
|
| + class X {}''');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertSuggestImportedClass('A');
|
| + assertSuggestImportedClass('B');
|
| + assertSuggestImportedClass('PB');
|
| + assertSuggestImportedTopLevelVar('T1', null);
|
| + assertSuggestImportedFunction('F1', 'PB');
|
| + assertNotSuggested('C');
|
| + assertNotSuggested('D');
|
| + assertNotSuggested('X');
|
| + assertNotSuggested('Object');
|
| + });
|
| + }
|
| +
|
| + test_Combinator_show() {
|
| + // SimpleIdentifier HideCombinator ImportDirective
|
| + addSource('/testAB.dart', '''
|
| + library libAB;
|
| + part '/partAB.dart';
|
| + class A { }
|
| + class B { }''');
|
| + addSource('/partAB.dart', '''
|
| + part of libAB;
|
| + var T1;
|
| + PB F1() => new PB();
|
| + class PB { }''');
|
| + addSource('/testCD.dart', '''
|
| + class C { }
|
| + class D { }''');
|
| + addTestSource('''
|
| + import "/testAB.dart" show ^;
|
| + import "/testCD.dart";
|
| + class X {}''');
|
| + computeFast();
|
| + return computeFull(true).then((_) {
|
| + assertSuggestImportedClass('A');
|
| + assertSuggestImportedClass('B');
|
| + assertSuggestImportedClass('PB');
|
| + assertSuggestImportedTopLevelVar('T1', null);
|
| + assertSuggestImportedFunction('F1', 'PB');
|
| + assertNotSuggested('C');
|
| + assertNotSuggested('D');
|
| + assertNotSuggested('X');
|
| + assertNotSuggested('Object');
|
| + });
|
| + }
|
| +
|
| test_ConstructorName_importedClass() {
|
| // SimpleIdentifier PrefixedIdentifier TypeName ConstructorName
|
| // InstanceCreationExpression
|
|
|