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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 7 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
8 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; | 8 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; |
9 import 'package:analysis_server/src/services/correction/fix.dart'; | 9 import 'package:analysis_server/src/services/correction/fix.dart'; |
10 import 'package:analysis_server/src/services/correction/fix_internal.dart'; | 10 import 'package:analysis_server/src/services/correction/fix_internal.dart'; |
(...skipping 4512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4523 test(throw 42); | 4523 test(throw 42); |
4524 } | 4524 } |
4525 '''); | 4525 '''); |
4526 await assertHasFix( | 4526 await assertHasFix( |
4527 DartFixKind.CREATE_FUNCTION, | 4527 DartFixKind.CREATE_FUNCTION, |
4528 ''' | 4528 ''' |
4529 main() { | 4529 main() { |
4530 test(throw 42); | 4530 test(throw 42); |
4531 } | 4531 } |
4532 | 4532 |
4533 void test(arg0) { | 4533 void test(param0) { |
4534 } | 4534 } |
4535 '''); | 4535 '''); |
4536 } | 4536 } |
4537 | 4537 |
4538 test_undefinedFunction_create_duplicateArgumentNames() async { | 4538 test_undefinedFunction_create_duplicateArgumentNames() async { |
4539 await resolveTestUnit(''' | 4539 await resolveTestUnit(''' |
4540 class C { | 4540 class C { |
4541 int x; | 4541 int x; |
4542 } | 4542 } |
4543 | 4543 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4726 test(null); | 4726 test(null); |
4727 } | 4727 } |
4728 '''); | 4728 '''); |
4729 await assertHasFix( | 4729 await assertHasFix( |
4730 DartFixKind.CREATE_FUNCTION, | 4730 DartFixKind.CREATE_FUNCTION, |
4731 ''' | 4731 ''' |
4732 main() { | 4732 main() { |
4733 test(null); | 4733 test(null); |
4734 } | 4734 } |
4735 | 4735 |
4736 void test(arg0) { | 4736 void test(param0) { |
4737 } | 4737 } |
4738 '''); | 4738 '''); |
4739 } | 4739 } |
4740 | 4740 |
4741 test_undefinedFunction_create_returnType_bool_expressions() async { | 4741 test_undefinedFunction_create_returnType_bool_expressions() async { |
4742 await assert_undefinedFunction_create_returnType_bool("!test();"); | 4742 await assert_undefinedFunction_create_returnType_bool("!test();"); |
4743 await assert_undefinedFunction_create_returnType_bool("b && test();"); | 4743 await assert_undefinedFunction_create_returnType_bool("b && test();"); |
4744 await assert_undefinedFunction_create_returnType_bool("test() && b;"); | 4744 await assert_undefinedFunction_create_returnType_bool("test() && b;"); |
4745 await assert_undefinedFunction_create_returnType_bool("b || test();"); | 4745 await assert_undefinedFunction_create_returnType_bool("b || test();"); |
4746 await assert_undefinedFunction_create_returnType_bool("test() || b;"); | 4746 await assert_undefinedFunction_create_returnType_bool("test() || b;"); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5095 await assertHasFix( | 5095 await assertHasFix( |
5096 DartFixKind.CREATE_METHOD, | 5096 DartFixKind.CREATE_METHOD, |
5097 ''' | 5097 ''' |
5098 class A<T> { | 5098 class A<T> { |
5099 main() { | 5099 main() { |
5100 T t = new B().compute(); | 5100 T t = new B().compute(); |
5101 } | 5101 } |
5102 } | 5102 } |
5103 | 5103 |
5104 class B { | 5104 class B { |
5105 dynamic compute() {} | 5105 compute() {} |
5106 } | 5106 } |
5107 '''); | 5107 '''); |
5108 } | 5108 } |
5109 | 5109 |
5110 test_undefinedMethod_create_generic_OK_literal() async { | 5110 test_undefinedMethod_create_generic_OK_literal() async { |
5111 await resolveTestUnit(''' | 5111 await resolveTestUnit(''' |
5112 class A { | 5112 class A { |
5113 B b; | 5113 B b; |
5114 List<int> items; | 5114 List<int> items; |
5115 main() { | 5115 main() { |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6903 @override | 6903 @override |
6904 final AnalysisError error; | 6904 final AnalysisError error; |
6905 | 6905 |
6906 _DartFixContextImpl(this.resourceProvider, this.analysisDriver, | 6906 _DartFixContextImpl(this.resourceProvider, this.analysisDriver, |
6907 this.astProvider, this.unit, this.error); | 6907 this.astProvider, this.unit, this.error); |
6908 | 6908 |
6909 @override | 6909 @override |
6910 GetTopLevelDeclarations get getTopLevelDeclarations => | 6910 GetTopLevelDeclarations get getTopLevelDeclarations => |
6911 analysisDriver.getTopLevelNameDeclarations; | 6911 analysisDriver.getTopLevelNameDeclarations; |
6912 } | 6912 } |
OLD | NEW |