| Index: pkg/analysis_server/test/services/completion/completion_target_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/completion_target_test.dart b/pkg/analysis_server/test/services/completion/completion_target_test.dart
|
| index bb258c4345fd1866cea2d408b5829bb4165e822c..426352c581d80e0695d32f9f52acca8efc719f07 100644
|
| --- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
|
| @@ -59,6 +59,12 @@ class CompletionTargetTest extends AbstractContextTest {
|
| assertTarget(')', '()', argIndex: 0);
|
| }
|
|
|
| + test_ArgumentList_InstanceCreationExpression_functionArg2() {
|
| + // ArgumentList InstanceCreationExpression Block
|
| + addTestSource('main() {new B(^)} class B{B(f()){}}');
|
| + assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true);
|
| + }
|
| +
|
| test_ArgumentList_MethodInvocation() {
|
| // ArgumentList MethodInvocation Block
|
| addTestSource('main() {foo(^)}');
|
| @@ -95,12 +101,6 @@ class CompletionTargetTest extends AbstractContextTest {
|
| assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true);
|
| }
|
|
|
| - test_ArgumentList_InstanceCreationExpression_functionArg2() {
|
| - // ArgumentList InstanceCreationExpression Block
|
| - addTestSource('main() {new B(^)} class B{B(f()){}}');
|
| - assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true);
|
| - }
|
| -
|
| test_AsExpression_identifier() {
|
| // SimpleIdentifier TypeName AsExpression
|
| addTestSource('class A {var b; X _c; foo() {var a; (a^ as String).foo();}');
|
| @@ -155,6 +155,161 @@ class CompletionTargetTest extends AbstractContextTest {
|
| assertTarget('new C();', '{var f; {var x;} new C();}');
|
| }
|
|
|
| + test_MethodDeclaration_inLineComment() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + // normal comment ^
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('// normal comment ', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inLineComment2() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + // normal ^comment
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('// normal comment', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inLineComment3() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + // normal comment ^
|
| + // normal comment 2
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('// normal comment ', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inLineComment4() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + // normal comment
|
| + // normal comment 2^
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('// normal comment 2', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inLineDocComment() {
|
| + // Comment MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + /// some dartdoc ^
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('/// some dartdoc ', '');
|
| + expect(target.containingNode is Comment, isTrue);
|
| + expect(target.containingNode.parent.toSource(), 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inLineDocComment2() {
|
| + // Comment MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + /// some ^dartdoc
|
| + zoo(z) { } String name; }''');
|
| + assertTarget('/// some dartdoc', '');
|
| + expect(target.containingNode is Comment, isTrue);
|
| + expect(target.containingNode.parent.toSource(), 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inStarComment() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/* ^ */ zoo(z) {} String name;}');
|
| + assertTarget('/* */', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inStarComment2() {
|
| + // Comment ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/* *^/ zoo(z) {} String name;}');
|
| + assertTarget('/* */', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inStarDocComment() {
|
| + // Comment MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/** ^ */ zoo(z) { } String name; }');
|
| + assertTarget('/** */', '');
|
| + expect(target.containingNode is Comment, isTrue);
|
| + expect(target.containingNode.parent.toSource(), 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_inStarDocComment2() {
|
| + // Comment MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/** *^/ zoo(z) { } String name; }');
|
| + assertTarget('/** */', '');
|
| + expect(target.containingNode is Comment, isTrue);
|
| + expect(target.containingNode.parent.toSource(), 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType() {
|
| + // ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {^ zoo(z) { } String name; }');
|
| + assertTarget('zoo(z) {}', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterLineComment() {
|
| + // MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + // normal comment
|
| + ^ zoo(z) {} String name;}''');
|
| + assertTarget('zoo(z) {}', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterLineComment2() {
|
| + // MethodDeclaration ClassDeclaration CompilationUnit
|
| + // TOD(danrubel) left align all test source
|
| + addTestSource('''
|
| +class C2 {
|
| + // normal comment
|
| +^ zoo(z) {} String name;}''');
|
| + assertTarget('zoo(z) {}', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterLineDocComment() {
|
| + // SimpleIdentifier MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| + class C2 {
|
| + /// some dartdoc
|
| + ^ zoo(z) { } String name; }''');
|
| + assertTarget('zoo', 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterLineDocComment2() {
|
| + // SimpleIdentifier MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('''
|
| +class C2 {
|
| + /// some dartdoc
|
| +^ zoo(z) { } String name; }''');
|
| + assertTarget('zoo', 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterStarComment() {
|
| + // ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/* */ ^ zoo(z) { } String name; }');
|
| + assertTarget('zoo(z) {}', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterStarComment2() {
|
| + // ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/* */^ zoo(z) { } String name; }');
|
| + assertTarget('zoo(z) {}', 'class C2 {zoo(z) {} String name;}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterStarDocComment() {
|
| + // MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/** */ ^ zoo(z) { } String name; }');
|
| + assertTarget('zoo', 'zoo(z) {}');
|
| + }
|
| +
|
| + test_MethodDeclaration_returnType_afterStarDocComment2() {
|
| + // MethodDeclaration ClassDeclaration CompilationUnit
|
| + addTestSource('class C2 {/** */^ zoo(z) { } String name; }');
|
| + assertTarget('zoo', 'zoo(z) {}');
|
| + }
|
| +
|
| test_VariableDeclaration_lhs_identifier_after() {
|
| // VariableDeclaration VariableDeclarationList
|
| addTestSource('main() {int b^ = 1;}');
|
|
|