Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1661763002: WEB-20151. Include type arguments into type proposals. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/edit/fix/fix_dart.dart'; 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart';
(...skipping 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 class A { 3877 class A {
3878 List<int> items; 3878 List<int> items;
3879 main() { 3879 main() {
3880 process(items); 3880 process(items);
3881 } 3881 }
3882 } 3882 }
3883 3883
3884 void process(List<int> items) { 3884 void process(List<int> items) {
3885 } 3885 }
3886 '''); 3886 ''');
3887 _assertLinkedGroup(
3888 change.linkedEditGroups[2],
3889 ['List<int> items) {'],
3890 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
3891 ['List<int>', 'Iterable<int>', 'Object']));
3887 } 3892 }
3888 3893
3889 test_undefinedFunction_create_importType() async { 3894 test_undefinedFunction_create_importType() async {
3890 addSource( 3895 addSource(
3891 '/lib.dart', 3896 '/lib.dart',
3892 r''' 3897 r'''
3893 library lib; 3898 library lib;
3894 import 'dart:async'; 3899 import 'dart:async';
3895 Future getFuture() => null; 3900 Future getFuture() => null;
3896 '''); 3901 ''');
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 // linked positions 4434 // linked positions
4430 int index = 0; 4435 int index = 0;
4431 _assertLinkedGroup( 4436 _assertLinkedGroup(
4432 change.linkedEditGroups[index++], ['void myUndefinedMethod(']); 4437 change.linkedEditGroups[index++], ['void myUndefinedMethod(']);
4433 _assertLinkedGroup(change.linkedEditGroups[index++], 4438 _assertLinkedGroup(change.linkedEditGroups[index++],
4434 ['myUndefinedMethod(0', 'myUndefinedMethod(int']); 4439 ['myUndefinedMethod(0', 'myUndefinedMethod(int']);
4435 _assertLinkedGroup( 4440 _assertLinkedGroup(
4436 change.linkedEditGroups[index++], 4441 change.linkedEditGroups[index++],
4437 ['int i'], 4442 ['int i'],
4438 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4443 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4439 ['int', 'num', 'Object', 'Comparable'])); 4444 ['int', 'num', 'Object', 'Comparable<num>']));
4440 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']); 4445 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']);
4441 _assertLinkedGroup( 4446 _assertLinkedGroup(
4442 change.linkedEditGroups[index++], 4447 change.linkedEditGroups[index++],
4443 ['double d'], 4448 ['double d'],
4444 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4449 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4445 ['double', 'num', 'Object', 'Comparable'])); 4450 ['double', 'num', 'Object', 'Comparable<num>']));
4446 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']); 4451 _assertLinkedGroup(change.linkedEditGroups[index++], ['d,']);
4447 _assertLinkedGroup( 4452 _assertLinkedGroup(
4448 change.linkedEditGroups[index++], 4453 change.linkedEditGroups[index++],
4449 ['String s'], 4454 ['String s'],
4450 expectedSuggestions( 4455 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4451 LinkedEditSuggestionKind.TYPE, ['String', 'Object', 'Comparable'])); 4456 ['String', 'Object', 'Comparable<String>']));
4452 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']); 4457 _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']);
4453 } 4458 }
4454 4459
4455 test_undefinedMethod_createUnqualified_parameters_named() async { 4460 test_undefinedMethod_createUnqualified_parameters_named() async {
4456 resolveTestUnit(''' 4461 resolveTestUnit('''
4457 class A { 4462 class A {
4458 main() { 4463 main() {
4459 myUndefinedMethod(0, bbb: 1.0, ccc: '2'); 4464 myUndefinedMethod(0, bbb: 1.0, ccc: '2');
4460 } 4465 }
4461 } 4466 }
(...skipping 13 matching lines...) Expand all
4475 // linked positions 4480 // linked positions
4476 int index = 0; 4481 int index = 0;
4477 _assertLinkedGroup( 4482 _assertLinkedGroup(
4478 change.linkedEditGroups[index++], ['void myUndefinedMethod(']); 4483 change.linkedEditGroups[index++], ['void myUndefinedMethod(']);
4479 _assertLinkedGroup(change.linkedEditGroups[index++], 4484 _assertLinkedGroup(change.linkedEditGroups[index++],
4480 ['myUndefinedMethod(0', 'myUndefinedMethod(int']); 4485 ['myUndefinedMethod(0', 'myUndefinedMethod(int']);
4481 _assertLinkedGroup( 4486 _assertLinkedGroup(
4482 change.linkedEditGroups[index++], 4487 change.linkedEditGroups[index++],
4483 ['int i'], 4488 ['int i'],
4484 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4489 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4485 ['int', 'num', 'Object', 'Comparable'])); 4490 ['int', 'num', 'Object', 'Comparable<num>']));
4486 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']); 4491 _assertLinkedGroup(change.linkedEditGroups[index++], ['i,']);
4487 _assertLinkedGroup( 4492 _assertLinkedGroup(
4488 change.linkedEditGroups[index++], 4493 change.linkedEditGroups[index++],
4489 ['double bbb'], 4494 ['double bbb'],
4490 expectedSuggestions(LinkedEditSuggestionKind.TYPE, 4495 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4491 ['double', 'num', 'Object', 'Comparable'])); 4496 ['double', 'num', 'Object', 'Comparable<num>']));
4492 _assertLinkedGroup( 4497 _assertLinkedGroup(
4493 change.linkedEditGroups[index++], 4498 change.linkedEditGroups[index++],
4494 ['String ccc'], 4499 ['String ccc'],
4495 expectedSuggestions( 4500 expectedSuggestions(LinkedEditSuggestionKind.TYPE,
4496 LinkedEditSuggestionKind.TYPE, ['String', 'Object', 'Comparable'])); 4501 ['String', 'Object', 'Comparable<String>']));
4497 } 4502 }
4498 4503
4499 test_undefinedMethod_createUnqualified_returnType() async { 4504 test_undefinedMethod_createUnqualified_returnType() async {
4500 resolveTestUnit(''' 4505 resolveTestUnit('''
4501 class A { 4506 class A {
4502 main() { 4507 main() {
4503 int v = myUndefinedMethod(); 4508 int v = myUndefinedMethod();
4504 } 4509 }
4505 } 4510 }
4506 '''); 4511 ''');
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
4927 int offset = resultCode.indexOf(search); 4932 int offset = resultCode.indexOf(search);
4928 positions.add(new Position(testFile, offset)); 4933 positions.add(new Position(testFile, offset));
4929 } 4934 }
4930 return positions; 4935 return positions;
4931 } 4936 }
4932 4937
4933 void _performAnalysis() { 4938 void _performAnalysis() {
4934 while (context.performAnalysisTask().hasMoreWork); 4939 while (context.performAnalysisTask().hasMoreWork);
4935 } 4940 }
4936 } 4941 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698