| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.services.completion.target; | 5 library test.services.completion.target; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/completion/completion_target.dart'; | 7 import 'package:analysis_server/src/services/completion/completion_target.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 addTestSource('main() {new Foo(^)}'); | 58 addTestSource('main() {new Foo(^)}'); |
| 59 assertTarget(')', '()', argIndex: 0); | 59 assertTarget(')', '()', argIndex: 0); |
| 60 } | 60 } |
| 61 | 61 |
| 62 test_ArgumentList_InstanceCreationExpression_functionArg2() { | 62 test_ArgumentList_InstanceCreationExpression_functionArg2() { |
| 63 // ArgumentList InstanceCreationExpression Block | 63 // ArgumentList InstanceCreationExpression Block |
| 64 addTestSource('main() {new B(^)} class B{B(f()){}}'); | 64 addTestSource('main() {new B(^)} class B{B(f()){}}'); |
| 65 assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true); | 65 assertTarget(')', '()', argIndex: 0, isFunctionalArgument: true); |
| 66 } | 66 } |
| 67 | 67 |
| 68 test_TypeArgumentList() { |
| 69 // SimpleIdentifier BinaryExpression ExpressionStatement |
| 70 addTestSource('main() { C<^> c; }'); |
| 71 assertTarget('', 'C < '); |
| 72 } |
| 73 |
| 74 test_TypeArgumentList2() { |
| 75 // TypeName TypeArgumentList TypeName |
| 76 addTestSource('main() { C<C^> c; }'); |
| 77 assertTarget('C', '<C>'); |
| 78 } |
| 79 |
| 68 test_ArgumentList_MethodInvocation() { | 80 test_ArgumentList_MethodInvocation() { |
| 69 // ArgumentList MethodInvocation Block | 81 // ArgumentList MethodInvocation Block |
| 70 addTestSource('main() {foo(^)}'); | 82 addTestSource('main() {foo(^)}'); |
| 71 assertTarget(')', '()', argIndex: 0); | 83 assertTarget(')', '()', argIndex: 0); |
| 72 } | 84 } |
| 73 | 85 |
| 74 test_ArgumentList_MethodInvocation2() { | 86 test_ArgumentList_MethodInvocation2() { |
| 75 // ArgumentList MethodInvocation Block | 87 // ArgumentList MethodInvocation Block |
| 76 addTestSource('main() {foo(^n)}'); | 88 addTestSource('main() {foo(^n)}'); |
| 77 assertTarget('n', '(n)', argIndex: 0); | 89 assertTarget('n', '(n)', argIndex: 0); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 addTestSource('main() {int b^ = 1;}'); | 472 addTestSource('main() {int b^ = 1;}'); |
| 461 assertTarget('b = 1', 'int b = 1'); | 473 assertTarget('b = 1', 'int b = 1'); |
| 462 } | 474 } |
| 463 | 475 |
| 464 test_VariableDeclaration_lhs_identifier_before() { | 476 test_VariableDeclaration_lhs_identifier_before() { |
| 465 // VariableDeclaration VariableDeclarationList | 477 // VariableDeclaration VariableDeclarationList |
| 466 addTestSource('main() {int ^b = 1;}'); | 478 addTestSource('main() {int ^b = 1;}'); |
| 467 assertTarget('b = 1', 'int b = 1'); | 479 assertTarget('b = 1', 'int b = 1'); |
| 468 } | 480 } |
| 469 } | 481 } |
| OLD | NEW |