| Index: pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
|
| index fc707f9be92bcd8465fc192badef1612297bbaf2..eeab8d7be89e5922a6081ecaf625c938f5a16378 100644
|
| --- a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
|
| @@ -64,7 +64,8 @@ class LocalLibraryContributorTest extends DartCompletionContributorTest {
|
| relevance: DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
|
| }
|
|
|
| - test_partFile_TypeName() async {
|
| + test_partFile_Constructor2() async {
|
| + // SimpleIdentifier TypeName ConstructorName
|
| addSource(
|
| '/testB.dart',
|
| '''
|
| @@ -75,32 +76,22 @@ class LocalLibraryContributorTest extends DartCompletionContributorTest {
|
| addSource(
|
| '/testA.dart',
|
| '''
|
| + part of libA;
|
| + class B { }''');
|
| + addTestSource('''
|
| library libA;
|
| import "/testB.dart";
|
| - part "$testFile";
|
| - class A { var a1; a2(){}}
|
| - var m;
|
| - typedef t1(int blue);
|
| - int af() {return 0;}''');
|
| - addTestSource('''
|
| - part of libA;
|
| - class B { factory B.bar(int x) => null; }
|
| - main() {^}''');
|
| + part "/testA.dart";
|
| + class A { A({String boo: 'hoo'}) { } }
|
| + main() {new ^}
|
| + var m;''');
|
| await computeLibrariesContaining();
|
| await computeSuggestions();
|
| expect(replacementOffset, completionOffset);
|
| expect(replacementLength, 0);
|
| - assertSuggestClass('A');
|
| - assertSuggestFunction('af', 'int',
|
| - relevance: DART_RELEVANCE_LOCAL_FUNCTION);
|
| - assertSuggestTopLevelVar('m', null,
|
| - relevance: DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
|
| - assertSuggestFunctionTypeAlias('t1', null,
|
| - relevance: DART_RELEVANCE_LOCAL_FUNCTION);
|
| - assertNotSuggested('a1');
|
| - assertNotSuggested('a2');
|
| - // Suggested by LocalConstructorContributor
|
| - assertNotSuggested('B.bar');
|
| + assertSuggestConstructor('B');
|
| + // Suggested by ConstructorContributor
|
| + assertNotSuggested('A');
|
| // Suggested by ImportedReferenceContributor
|
| assertNotSuggested('Object');
|
| assertNotSuggested('X.c');
|
| @@ -109,10 +100,10 @@ class LocalLibraryContributorTest extends DartCompletionContributorTest {
|
| assertNotSuggested('T1');
|
| assertNotSuggested('_d');
|
| assertNotSuggested('z');
|
| + assertNotSuggested('m');
|
| }
|
|
|
| - test_partFile_Constructor2() async {
|
| - // SimpleIdentifier TypeName ConstructorName
|
| + test_partFile_TypeName() async {
|
| addSource(
|
| '/testB.dart',
|
| '''
|
| @@ -123,22 +114,32 @@ class LocalLibraryContributorTest extends DartCompletionContributorTest {
|
| addSource(
|
| '/testA.dart',
|
| '''
|
| - part of libA;
|
| - class B { }''');
|
| - addTestSource('''
|
| library libA;
|
| import "/testB.dart";
|
| - part "/testA.dart";
|
| - class A { A({String boo: 'hoo'}) { } }
|
| - main() {new ^}
|
| - var m;''');
|
| + part "$testFile";
|
| + class A { var a1; a2(){}}
|
| + var m;
|
| + typedef t1(int blue);
|
| + int af() {return 0;}''');
|
| + addTestSource('''
|
| + part of libA;
|
| + class B { factory B.bar(int x) => null; }
|
| + main() {^}''');
|
| await computeLibrariesContaining();
|
| await computeSuggestions();
|
| expect(replacementOffset, completionOffset);
|
| expect(replacementLength, 0);
|
| - assertSuggestConstructor('B');
|
| - // Suggested by ConstructorContributor
|
| - assertNotSuggested('A');
|
| + assertSuggestClass('A');
|
| + assertSuggestFunction('af', 'int',
|
| + relevance: DART_RELEVANCE_LOCAL_FUNCTION);
|
| + assertSuggestTopLevelVar('m', null,
|
| + relevance: DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
|
| + assertSuggestFunctionTypeAlias('t1', null,
|
| + relevance: DART_RELEVANCE_LOCAL_FUNCTION);
|
| + assertNotSuggested('a1');
|
| + assertNotSuggested('a2');
|
| + // Suggested by LocalConstructorContributor
|
| + assertNotSuggested('B.bar');
|
| // Suggested by ImportedReferenceContributor
|
| assertNotSuggested('Object');
|
| assertNotSuggested('X.c');
|
| @@ -147,7 +148,6 @@ class LocalLibraryContributorTest extends DartCompletionContributorTest {
|
| assertNotSuggested('T1');
|
| assertNotSuggested('_d');
|
| assertNotSuggested('z');
|
| - assertNotSuggested('m');
|
| }
|
|
|
| test_partFile_TypeName2() async {
|
|
|