| 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.correction.fix; | 5 library test.services.correction.fix; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
| 10 import 'package:analysis_server/plugin/protocol/protocol.dart' | 10 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| (...skipping 4250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4261 process(items); | 4261 process(items); |
| 4262 } | 4262 } |
| 4263 } | 4263 } |
| 4264 | 4264 |
| 4265 void process(List<int> items) { | 4265 void process(List<int> items) { |
| 4266 } | 4266 } |
| 4267 '''); | 4267 '''); |
| 4268 _assertLinkedGroup( | 4268 _assertLinkedGroup( |
| 4269 change.linkedEditGroups[2], | 4269 change.linkedEditGroups[2], |
| 4270 ['List<int> items) {'], | 4270 ['List<int> items) {'], |
| 4271 expectedSuggestions(LinkedEditSuggestionKind.TYPE, | 4271 expectedSuggestions(LinkedEditSuggestionKind.TYPE, [ |
| 4272 ['List<int>', 'Iterable<int>', 'Object'])); | 4272 'List<int>', |
| 4273 'EfficientLengthIterable<int>', |
| 4274 'Iterable<int>', |
| 4275 'Object' |
| 4276 ])); |
| 4273 } | 4277 } |
| 4274 | 4278 |
| 4275 test_undefinedFunction_create_importType() async { | 4279 test_undefinedFunction_create_importType() async { |
| 4276 addSource( | 4280 addSource( |
| 4277 '/lib.dart', | 4281 '/lib.dart', |
| 4278 r''' | 4282 r''' |
| 4279 library lib; | 4283 library lib; |
| 4280 import 'dart:async'; | 4284 import 'dart:async'; |
| 4281 Future getFuture() => null; | 4285 Future getFuture() => null; |
| 4282 '''); | 4286 '''); |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4901 _assertLinkedGroup( | 4905 _assertLinkedGroup( |
| 4902 change.linkedEditGroups[index++], | 4906 change.linkedEditGroups[index++], |
| 4903 ['double d'], | 4907 ['double d'], |
| 4904 expectedSuggestions(LinkedEditSuggestionKind.TYPE, | 4908 expectedSuggestions(LinkedEditSuggestionKind.TYPE, |
| 4905 ['double', 'num', 'Object', 'Comparable<num>'])); | 4909 ['double', 'num', 'Object', 'Comparable<num>'])); |
| 4906 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']); | 4910 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']); |
| 4907 _assertLinkedGroup( | 4911 _assertLinkedGroup( |
| 4908 change.linkedEditGroups[index++], | 4912 change.linkedEditGroups[index++], |
| 4909 ['String s'], | 4913 ['String s'], |
| 4910 expectedSuggestions(LinkedEditSuggestionKind.TYPE, | 4914 expectedSuggestions(LinkedEditSuggestionKind.TYPE, |
| 4911 ['String', 'Object', 'Comparable<String>'])); | 4915 ['String', 'Object', 'Comparable<String>', 'Pattern'])); |
| 4912 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']); | 4916 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']); |
| 4913 } | 4917 } |
| 4914 | 4918 |
| 4915 test_undefinedMethod_createUnqualified_parameters_named() async { | 4919 test_undefinedMethod_createUnqualified_parameters_named() async { |
| 4916 resolveTestUnit(''' | 4920 resolveTestUnit(''' |
| 4917 class A { | 4921 class A { |
| 4918 main() { | 4922 main() { |
| 4919 myUndefinedMethod(0, bbb: 1.0, ccc: '2'); | 4923 myUndefinedMethod(0, bbb: 1.0, ccc: '2'); |
| 4920 } | 4924 } |
| 4921 } | 4925 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 4945 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']); | 4949 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']); |
| 4946 _assertLinkedGroup( | 4950 _assertLinkedGroup( |
| 4947 change.linkedEditGroups[index++], | 4951 change.linkedEditGroups[index++], |
| 4948 ['double bbb'], | 4952 ['double bbb'], |
| 4949 expectedSuggestions(LinkedEditSuggestionKind.TYPE, | 4953 expectedSuggestions(LinkedEditSuggestionKind.TYPE, |
| 4950 ['double', 'num', 'Object', 'Comparable<num>'])); | 4954 ['double', 'num', 'Object', 'Comparable<num>'])); |
| 4951 _assertLinkedGroup( | 4955 _assertLinkedGroup( |
| 4952 change.linkedEditGroups[index++], | 4956 change.linkedEditGroups[index++], |
| 4953 ['String ccc'], | 4957 ['String ccc'], |
| 4954 expectedSuggestions(LinkedEditSuggestionKind.TYPE, | 4958 expectedSuggestions(LinkedEditSuggestionKind.TYPE, |
| 4955 ['String', 'Object', 'Comparable<String>'])); | 4959 ['String', 'Object', 'Comparable<String>', 'Pattern'])); |
| 4956 } | 4960 } |
| 4957 | 4961 |
| 4958 test_undefinedMethod_createUnqualified_returnType() async { | 4962 test_undefinedMethod_createUnqualified_returnType() async { |
| 4959 resolveTestUnit(''' | 4963 resolveTestUnit(''' |
| 4960 class A { | 4964 class A { |
| 4961 main() { | 4965 main() { |
| 4962 int v = myUndefinedMethod(); | 4966 int v = myUndefinedMethod(); |
| 4963 } | 4967 } |
| 4964 } | 4968 } |
| 4965 '''); | 4969 '''); |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5536 var v = 42; | 5540 var v = 42; |
| 5537 print('v: $v'); | 5541 print('v: $v'); |
| 5538 } | 5542 } |
| 5539 '''); | 5543 '''); |
| 5540 } | 5544 } |
| 5541 | 5545 |
| 5542 void verifyResult(String expectedResult) { | 5546 void verifyResult(String expectedResult) { |
| 5543 expect(resultCode, expectedResult); | 5547 expect(resultCode, expectedResult); |
| 5544 } | 5548 } |
| 5545 } | 5549 } |
| OLD | NEW |