Chromium Code Reviews| 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/protocol/protocol_generated.dart' | 9 import 'package:analysis_server/protocol/protocol_generated.dart' |
| 10 hide AnalysisError; | 10 hide AnalysisError; |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 | 573 |
| 574 test_addMissingRequiredArg_cons_single_closure_4() async { | 574 test_addMissingRequiredArg_cons_single_closure_4() async { |
| 575 _addMetaPackageSource(); | 575 _addMetaPackageSource(); |
| 576 | 576 |
| 577 addSource( | 577 addSource( |
| 578 '/libA.dart', | 578 '/libA.dart', |
| 579 r''' | 579 r''' |
| 580 library libA; | 580 library libA; |
| 581 import 'package:meta/meta.dart'; | 581 import 'package:meta/meta.dart'; |
| 582 | 582 |
| 583 typedef int Callback(a,b,c); | 583 typedef int Callback(int a, String b,c); |
|
Brian Wilkerson
2017/05/04 18:04:58
It would be good if we always added a space after
pquitslund
2017/05/04 19:53:58
And actually we do! This is the test source. The
| |
| 584 | 584 |
| 585 class A { | 585 class A { |
| 586 A({@required Callback callback}) {} | 586 A({@required Callback callback}) {} |
| 587 } | 587 } |
| 588 '''); | 588 '''); |
| 589 | 589 |
| 590 await resolveTestUnit(''' | 590 await resolveTestUnit(''' |
| 591 import 'libA.dart'; | 591 import 'libA.dart'; |
| 592 | 592 |
| 593 main() { | 593 main() { |
| 594 A a = new A(); | 594 A a = new A(); |
| 595 } | 595 } |
| 596 '''); | 596 '''); |
| 597 await assertHasFix( | 597 await assertHasFix( |
| 598 DartFixKind.ADD_MISSING_REQUIRED_ARGUMENT, | 598 DartFixKind.ADD_MISSING_REQUIRED_ARGUMENT, |
| 599 ''' | 599 ''' |
| 600 import 'libA.dart'; | 600 import 'libA.dart'; |
| 601 | 601 |
| 602 main() { | 602 main() { |
| 603 A a = new A(callback: (a, b, c) {}); | 603 A a = new A(callback: (int a, String b, c) {}); |
| 604 } | 604 } |
| 605 ''', | 605 ''', |
| 606 target: '/test.dart'); | 606 target: '/test.dart'); |
| 607 } | 607 } |
| 608 | 608 |
| 609 test_addMissingRequiredArg_cons_single_list() async { | 609 test_addMissingRequiredArg_cons_single_list() async { |
| 610 _addMetaPackageSource(); | 610 _addMetaPackageSource(); |
| 611 | 611 |
| 612 addSource( | 612 addSource( |
| 613 '/libA.dart', | 613 '/libA.dart', |
| (...skipping 6275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6889 | 6889 |
| 6890 @override | 6890 @override |
| 6891 final CompilationUnit unit; | 6891 final CompilationUnit unit; |
| 6892 | 6892 |
| 6893 @override | 6893 @override |
| 6894 final AnalysisError error; | 6894 final AnalysisError error; |
| 6895 | 6895 |
| 6896 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations, | 6896 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations, |
| 6897 this.analysisContext, this.astProvider, this.unit, this.error); | 6897 this.analysisContext, this.astProvider, this.unit, this.error); |
| 6898 } | 6898 } |
| OLD | NEW |