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

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

Issue 2864373003: Add trailing commas after Flutter instance creation params fixes (flutter-intellij/#f978). (Closed)
Patch Set: Created 3 years, 7 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 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
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
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 }
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