| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 ''' | 426 ''' |
| 427 class A { | 427 class A { |
| 428 test(int i) {} | 428 test(int i) {} |
| 429 main() { | 429 main() { |
| 430 test(1); | 430 test(1); |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 '''); | 433 '''); |
| 434 } | 434 } |
| 435 | 435 |
| 436 test_addMissingRequiredArg_cons_flutter_children() async { |
| 437 addPackageSource( |
| 438 'flutter', 'src/widgets/framework.dart', flutter_framework_code); |
| 439 |
| 440 _addMetaPackageSource(); |
| 441 |
| 442 await resolveTestUnit(''' |
| 443 import 'package:flutter/src/widgets/framework.dart'; |
| 444 import 'package:meta/meta.dart'; |
| 445 |
| 446 class MyWidget extends Widget { |
| 447 MyWidget({@required List<Widget> children}); |
| 448 } |
| 449 |
| 450 build() { |
| 451 return new MyWidget(); |
| 452 } |
| 453 '''); |
| 454 |
| 455 await assertHasFix( |
| 456 DartFixKind.ADD_MISSING_REQUIRED_ARGUMENT, |
| 457 ''' |
| 458 import 'package:flutter/src/widgets/framework.dart'; |
| 459 import 'package:meta/meta.dart'; |
| 460 |
| 461 class MyWidget extends Widget { |
| 462 MyWidget({@required List<Widget> children}); |
| 463 } |
| 464 |
| 465 build() { |
| 466 return new MyWidget(children: <Widget>[],); |
| 467 } |
| 468 ''', |
| 469 target: '/test.dart'); |
| 470 } |
| 471 |
| 436 test_addMissingRequiredArg_cons_single() async { | 472 test_addMissingRequiredArg_cons_single() async { |
| 437 _addMetaPackageSource(); | 473 _addMetaPackageSource(); |
| 438 addSource( | 474 addSource( |
| 439 '/libA.dart', | 475 '/libA.dart', |
| 440 r''' | 476 r''' |
| 441 library libA; | 477 library libA; |
| 442 import 'package:meta/meta.dart'; | 478 import 'package:meta/meta.dart'; |
| 443 | 479 |
| 444 class A { | 480 class A { |
| 445 A({@required int a}) {} | 481 A({@required int a}) {} |
| (...skipping 6430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6876 | 6912 |
| 6877 @override | 6913 @override |
| 6878 final CompilationUnit unit; | 6914 final CompilationUnit unit; |
| 6879 | 6915 |
| 6880 @override | 6916 @override |
| 6881 final AnalysisError error; | 6917 final AnalysisError error; |
| 6882 | 6918 |
| 6883 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations, | 6919 _DartFixContextImpl(this.resourceProvider, this.getTopLevelDeclarations, |
| 6884 this.analysisContext, this.astProvider, this.unit, this.error); | 6920 this.analysisContext, this.astProvider, this.unit, this.error); |
| 6885 } | 6921 } |
| OLD | NEW |