| 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 f7c77ab37dcc5947ab7bfb0911d9feaf20d278d1..edafc5f82e2e838869d30377e8df5b70010ee12c 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| @@ -2111,6 +2111,100 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
|
| });
|
| }
|
|
|
| + test_FunctionDeclaration_returnType_afterComment() {
|
| + // ClassDeclaration CompilationUnit
|
| + addSource('/testA.dart', '''
|
| + int T1;
|
| + F1() { }
|
| + typedef D1();
|
| + class C1 {C1(this.x) { } int x;}''');
|
| + addTestSource('''
|
| + import "/testA.dart";
|
| + int T2;
|
| + F2() { }
|
| + typedef D2();
|
| + class C2 { }
|
| + /* */ ^ zoo(z) { } String name;''');
|
| + computeFast();
|
| + return computeFull((bool result) {
|
| + expect(request.replacementOffset, completionOffset);
|
| + expect(request.replacementLength, 0);
|
| + assertSuggestImportedClass('Object');
|
| + assertNotSuggested('T1');
|
| + assertNotSuggested('F1');
|
| + assertSuggestImportedFunctionTypeAlias('D1', null);
|
| + assertSuggestImportedClass('C1');
|
| + assertNotSuggested('T2');
|
| + assertNotSuggested('F2');
|
| + assertSuggestLocalFunctionTypeAlias('D2', null);
|
| + assertSuggestLocalClass('C2');
|
| + assertNotSuggested('name');
|
| + });
|
| + }
|
| +
|
| + test_FunctionDeclaration_returnType_afterComment2() {
|
| + // FunctionDeclaration ClassDeclaration CompilationUnit
|
| + addSource('/testA.dart', '''
|
| + int T1;
|
| + F1() { }
|
| + typedef D1();
|
| + class C1 {C1(this.x) { } int x;}''');
|
| + addTestSource('''
|
| + import "/testA.dart";
|
| + int T2;
|
| + F2() { }
|
| + typedef D2();
|
| + class C2 { }
|
| + /** */ ^ zoo(z) { } String name;''');
|
| + computeFast();
|
| + return computeFull((bool result) {
|
| + expect(request.replacementOffset, completionOffset);
|
| + expect(request.replacementLength, 0);
|
| + assertSuggestImportedClass('Object');
|
| + assertNotSuggested('T1');
|
| + assertNotSuggested('F1');
|
| + assertSuggestImportedFunctionTypeAlias('D1', null);
|
| + assertSuggestImportedClass('C1');
|
| + assertNotSuggested('T2');
|
| + assertNotSuggested('F2');
|
| + assertSuggestLocalFunctionTypeAlias('D2', null);
|
| + assertSuggestLocalClass('C2');
|
| + assertNotSuggested('name');
|
| + });
|
| + }
|
| +
|
| + test_FunctionDeclaration_returnType_afterComment3() {
|
| + // FunctionDeclaration ClassDeclaration CompilationUnit
|
| + addSource('/testA.dart', '''
|
| + int T1;
|
| + F1() { }
|
| + typedef D1();
|
| + class C1 {C1(this.x) { } int x;}''');
|
| + addTestSource('''
|
| + import "/testA.dart";
|
| + int T2;
|
| + F2() { }
|
| + typedef D2();
|
| + /// some dartdoc
|
| + class C2 { }
|
| + ^ zoo(z) { } String name;''');
|
| + computeFast();
|
| + return computeFull((bool result) {
|
| + expect(request.replacementOffset, completionOffset);
|
| + expect(request.replacementLength, 0);
|
| + assertSuggestImportedClass('Object');
|
| + assertNotSuggested('T1');
|
| + assertNotSuggested('F1');
|
| + assertSuggestImportedFunctionTypeAlias('D1', null);
|
| + assertSuggestImportedClass('C1');
|
| + assertNotSuggested('T2');
|
| + assertNotSuggested('F2');
|
| + assertSuggestLocalFunctionTypeAlias('D2', null);
|
| + assertSuggestLocalClass('C2');
|
| + assertNotSuggested('name');
|
| + });
|
| + }
|
| +
|
| test_FunctionExpression_body_function() {
|
| // Block BlockFunctionBody FunctionExpression
|
| addTestSource('''
|
|
|