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.contributor.dart.optype; | 5 library test.services.completion.contributor.dart.optype; |
6 | 6 |
7 import 'package:analysis_server/src/protocol_server.dart'; | 7 import 'package:analysis_server/src/protocol_server.dart'; |
8 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; | 8 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; |
9 import 'package:analysis_server/src/services/completion/dart/optype.dart'; | 9 import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 | 661 |
662 test_FormalParameterList() { | 662 test_FormalParameterList() { |
663 // FormalParameterList MethodDeclaration | 663 // FormalParameterList MethodDeclaration |
664 addTestSource('class A {a(^) { }}'); | 664 addTestSource('class A {a(^) { }}'); |
665 assertOpType(typeNames: true); | 665 assertOpType(typeNames: true); |
666 } | 666 } |
667 | 667 |
668 test_ForStatement_condition() { | 668 test_ForStatement_condition() { |
669 // SimpleIdentifier ForStatement | 669 // SimpleIdentifier ForStatement |
670 addTestSource('main() {for (int index = 0; i^)}'); | 670 addTestSource('main() {for (int index = 0; i^)}'); |
671 // TODO (danrubel) may want to exclude methods/functions with void return | 671 assertOpType(returnValue: true, typeNames: true); |
672 assertOpType(returnValue: true, typeNames: true, voidReturn: true); | |
673 } | 672 } |
674 | 673 |
675 test_ForStatement_initializer() { | 674 test_ForStatement_initializer() { |
676 // SimpleIdentifier ForStatement | 675 // SimpleIdentifier ForStatement |
677 addTestSource('main() {List a; for (^)}'); | 676 addTestSource('main() {List a; for (^)}'); |
678 // TODO (danrubel) may want to exclude methods/functions with void return | 677 assertOpType(typeNames: true); |
679 assertOpType(returnValue: true, typeNames: true, voidReturn: true); | |
680 } | 678 } |
681 | 679 |
682 test_ForStatement_initializer_inKeyword() { | 680 test_ForStatement_initializer_inKeyword() { |
683 addTestSource('main() { for (var v i^) }'); | 681 addTestSource('main() { for (var v i^) }'); |
684 assertOpType(); | 682 assertOpType(); |
685 } | 683 } |
686 | 684 |
| 685 test_ForStatement_initializer_type() { |
| 686 // SimpleIdentifier ForStatement |
| 687 addTestSource('main() {List a; for (i^ v = 0;)}'); |
| 688 assertOpType(typeNames: true); |
| 689 } |
| 690 |
687 test_ForStatement_initializer_variableNameEmpty_afterType() { | 691 test_ForStatement_initializer_variableNameEmpty_afterType() { |
688 addTestSource('main() { for (String ^) }'); | 692 addTestSource('main() { for (String ^) }'); |
689 assertOpType(varNames: true); | 693 assertOpType(varNames: true); |
690 } | 694 } |
691 | 695 |
692 test_ForStatement_updaters() { | 696 test_ForStatement_updaters() { |
693 // SimpleIdentifier ForStatement | 697 // SimpleIdentifier ForStatement |
694 addTestSource('main() {for (int index = 0; index < 10; i^)}'); | 698 addTestSource('main() {for (int index = 0; index < 10; i^)}'); |
695 // TODO (danrubel) may want to exclude methods/functions with void return | 699 // TODO (danrubel) may want to exclude methods/functions with void return |
696 assertOpType(returnValue: true, typeNames: true, voidReturn: true); | 700 assertOpType(returnValue: true, typeNames: true, voidReturn: true); |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 bool get isInSystemLibrary => false; | 1552 bool get isInSystemLibrary => false; |
1549 | 1553 |
1550 @override | 1554 @override |
1551 String get shortName => fullName; | 1555 String get shortName => fullName; |
1552 | 1556 |
1553 @override | 1557 @override |
1554 Source get source => this; | 1558 Source get source => this; |
1555 | 1559 |
1556 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 1560 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
1557 } | 1561 } |
OLD | NEW |