| Index: pkg/analysis_server/test/services/correction/fix_test.dart
|
| diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| index 5d124f08279e475eea5eee2308e2d215145e2da9..3570b294d942b4dad4cad4de0760325c62ac0ad0 100644
|
| --- a/pkg/analysis_server/test/services/correction/fix_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| @@ -4,7 +4,10 @@
|
|
|
| library test.services.correction.fix;
|
|
|
| +import 'dart:async';
|
| +
|
| import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
|
| +import 'package:analysis_server/plugin/edit/fix/fix_dart.dart';
|
| import 'package:analysis_server/plugin/protocol/protocol.dart'
|
| hide AnalysisError;
|
| import 'package:analysis_server/src/services/correction/fix.dart';
|
| @@ -42,14 +45,14 @@ class FixProcessorTest extends AbstractSingleUnitTest {
|
| SourceChange change;
|
| String resultCode;
|
|
|
| - void assert_undefinedFunction_create_returnType_bool(String lineWithTest) {
|
| + assert_undefinedFunction_create_returnType_bool(String lineWithTest) async {
|
| resolveTestUnit('''
|
| main() {
|
| bool b = true;
|
| $lineWithTest
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -62,9 +65,9 @@ bool test() {
|
| ''');
|
| }
|
|
|
| - void assertHasFix(FixKind kind, String expected) {
|
| + assertHasFix(FixKind kind, String expected) async {
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(kind, error);
|
| + fix = await _assertHasFix(kind, error);
|
| change = fix.change;
|
| // apply to "file"
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -74,9 +77,9 @@ bool test() {
|
| expect(resultCode, expected);
|
| }
|
|
|
| - void assertNoFix(FixKind kind) {
|
| + assertNoFix(FixKind kind) async {
|
| AnalysisError error = _findErrorToFix();
|
| - List<Fix> fixes = _computeFixes(error);
|
| + List<Fix> fixes = await _computeFixes(error);
|
| for (Fix fix in fixes) {
|
| if (fix.kind == kind) {
|
| throw fail('Unexpected fix $kind in\n${fixes.join('\n')}');
|
| @@ -109,7 +112,7 @@ bool test() {
|
| verifyNoTestUnitErrors = false;
|
| }
|
|
|
| - void test_addFieldFormalParameters_hasRequiredParameter() {
|
| + test_addFieldFormalParameters_hasRequiredParameter() async {
|
| resolveTestUnit('''
|
| class Test {
|
| final int a;
|
| @@ -118,7 +121,7 @@ class Test {
|
| Test(this.a);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_FIELD_FORMAL_PARAMETERS,
|
| '''
|
| class Test {
|
| @@ -130,7 +133,7 @@ class Test {
|
| ''');
|
| }
|
|
|
| - void test_addFieldFormalParameters_noParameters() {
|
| + test_addFieldFormalParameters_noParameters() async {
|
| resolveTestUnit('''
|
| class Test {
|
| final int a;
|
| @@ -139,7 +142,7 @@ class Test {
|
| Test();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_FIELD_FORMAL_PARAMETERS,
|
| '''
|
| class Test {
|
| @@ -151,7 +154,7 @@ class Test {
|
| ''');
|
| }
|
|
|
| - void test_addFieldFormalParameters_noRequiredParameter() {
|
| + test_addFieldFormalParameters_noRequiredParameter() async {
|
| resolveTestUnit('''
|
| class Test {
|
| final int a;
|
| @@ -160,7 +163,7 @@ class Test {
|
| Test([this.c]);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_FIELD_FORMAL_PARAMETERS,
|
| '''
|
| class Test {
|
| @@ -172,14 +175,14 @@ class Test {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_function_positional_hasZero() {
|
| + test_addMissingParameter_function_positional_hasZero() async {
|
| resolveTestUnit('''
|
| test() {}
|
| main() {
|
| test(1);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_POSITIONAL,
|
| '''
|
| test([int i]) {}
|
| @@ -189,14 +192,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_function_required_hasOne() {
|
| + test_addMissingParameter_function_required_hasOne() async {
|
| resolveTestUnit('''
|
| test(int a) {}
|
| main() {
|
| test(1, 2.0);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_REQUIRED,
|
| '''
|
| test(int a, double d) {}
|
| @@ -206,14 +209,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_function_required_hasZero() {
|
| + test_addMissingParameter_function_required_hasZero() async {
|
| resolveTestUnit('''
|
| test() {}
|
| main() {
|
| test(1);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_REQUIRED,
|
| '''
|
| test(int i) {}
|
| @@ -223,7 +226,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_method_positional_hasOne() {
|
| + test_addMissingParameter_method_positional_hasOne() async {
|
| resolveTestUnit('''
|
| class A {
|
| test(int a) {}
|
| @@ -232,7 +235,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_POSITIONAL,
|
| '''
|
| class A {
|
| @@ -244,7 +247,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_method_required_hasOne() {
|
| + test_addMissingParameter_method_required_hasOne() async {
|
| resolveTestUnit('''
|
| class A {
|
| test(int a) {}
|
| @@ -253,7 +256,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_REQUIRED,
|
| '''
|
| class A {
|
| @@ -265,7 +268,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_addMissingParameter_method_required_hasZero() {
|
| + test_addMissingParameter_method_required_hasZero() async {
|
| resolveTestUnit('''
|
| class A {
|
| test() {}
|
| @@ -274,7 +277,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_MISSING_PARAMETER_REQUIRED,
|
| '''
|
| class A {
|
| @@ -286,7 +289,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_addPartOfDirective() {
|
| + test_addPartOfDirective() async {
|
| String partCode = r'''
|
| // Comment first.
|
| // Comment second.
|
| @@ -300,7 +303,7 @@ part 'part.dart';
|
| ''');
|
| _performAnalysis();
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.ADD_PART_OF, error);
|
| + fix = await _assertHasFix(DartFixKind.ADD_PART_OF, error);
|
| change = fix.change;
|
| // apply to "file"
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -319,14 +322,14 @@ class A {}
|
| ''');
|
| }
|
|
|
| - void test_addSync_BAD_nullFunctionBody() {
|
| + test_addSync_BAD_nullFunctionBody() async {
|
| resolveTestUnit('''
|
| var F = await;
|
| ''');
|
| - assertNoFix(DartFixKind.ADD_ASYNC);
|
| + await assertNoFix(DartFixKind.ADD_ASYNC);
|
| }
|
|
|
| - void test_addSync_blockFunctionBody() {
|
| + test_addSync_blockFunctionBody() async {
|
| resolveTestUnit('''
|
| foo() {}
|
| main() {
|
| @@ -340,11 +343,11 @@ main() {
|
| expect(errors.map((e) => e.message), unorderedEquals([message1, message2]));
|
| for (AnalysisError error in errors) {
|
| if (error.message == message1) {
|
| - List<Fix> fixes = _computeFixes(error);
|
| + List<Fix> fixes = await _computeFixes(error);
|
| expect(fixes, isEmpty);
|
| }
|
| if (error.message == message2) {
|
| - List<Fix> fixes = _computeFixes(error);
|
| + List<Fix> fixes = await _computeFixes(error);
|
| // has exactly one fix
|
| expect(fixes, hasLength(1));
|
| Fix fix = fixes[0];
|
| @@ -366,7 +369,7 @@ main() async {
|
| }
|
| }
|
|
|
| - void test_addSync_expressionFunctionBody() {
|
| + test_addSync_expressionFunctionBody() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER;
|
| };
|
| @@ -374,7 +377,7 @@ main() async {
|
| foo() {}
|
| main() => await foo();
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_ASYNC,
|
| '''
|
| foo() {}
|
| @@ -382,13 +385,13 @@ main() async => await foo();
|
| ''');
|
| }
|
|
|
| - void test_boolean() {
|
| + test_boolean() async {
|
| resolveTestUnit('''
|
| main() {
|
| boolean v;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_BOOLEAN_WITH_BOOL,
|
| '''
|
| main() {
|
| @@ -397,13 +400,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_canBeNullAfterNullAware_chain() {
|
| + test_canBeNullAfterNullAware_chain() async {
|
| resolveTestUnit('''
|
| main(x) {
|
| x?.a.b.c;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_WITH_NULL_AWARE,
|
| '''
|
| main(x) {
|
| @@ -412,13 +415,13 @@ main(x) {
|
| ''');
|
| }
|
|
|
| - void test_canBeNullAfterNullAware_methodInvocation() {
|
| + test_canBeNullAfterNullAware_methodInvocation() async {
|
| resolveTestUnit('''
|
| main(x) {
|
| x?.a.b();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_WITH_NULL_AWARE,
|
| '''
|
| main(x) {
|
| @@ -427,13 +430,13 @@ main(x) {
|
| ''');
|
| }
|
|
|
| - void test_canBeNullAfterNullAware_propertyAccess() {
|
| + test_canBeNullAfterNullAware_propertyAccess() async {
|
| resolveTestUnit('''
|
| main(x) {
|
| x?.a().b;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_WITH_NULL_AWARE,
|
| '''
|
| main(x) {
|
| @@ -442,7 +445,7 @@ main(x) {
|
| ''');
|
| }
|
|
|
| - void test_changeToStaticAccess_method() {
|
| + test_changeToStaticAccess_method() async {
|
| resolveTestUnit('''
|
| class A {
|
| static foo() {}
|
| @@ -451,7 +454,7 @@ main(A a) {
|
| a.foo();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO_STATIC_ACCESS,
|
| '''
|
| class A {
|
| @@ -463,7 +466,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_changeToStaticAccess_method_importType() {
|
| + test_changeToStaticAccess_method_importType() async {
|
| addSource(
|
| '/libA.dart',
|
| r'''
|
| @@ -485,7 +488,7 @@ main(B b) {
|
| b.foo();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO_STATIC_ACCESS,
|
| '''
|
| import 'libB.dart';
|
| @@ -496,14 +499,14 @@ main(B b) {
|
| ''');
|
| }
|
|
|
| - void test_changeToStaticAccess_method_prefixLibrary() {
|
| + test_changeToStaticAccess_method_prefixLibrary() async {
|
| resolveTestUnit('''
|
| import 'dart:async' as pref;
|
| main(pref.Future f) {
|
| f.wait([]);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO_STATIC_ACCESS,
|
| '''
|
| import 'dart:async' as pref;
|
| @@ -513,7 +516,7 @@ main(pref.Future f) {
|
| ''');
|
| }
|
|
|
| - void test_changeToStaticAccess_property() {
|
| + test_changeToStaticAccess_property() async {
|
| resolveTestUnit('''
|
| class A {
|
| static get foo => 42;
|
| @@ -522,7 +525,7 @@ main(A a) {
|
| a.foo;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO_STATIC_ACCESS,
|
| '''
|
| class A {
|
| @@ -534,7 +537,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_changeToStaticAccess_property_importType() {
|
| + test_changeToStaticAccess_property_importType() async {
|
| addSource(
|
| '/libA.dart',
|
| r'''
|
| @@ -556,7 +559,7 @@ main(B b) {
|
| b.foo;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO_STATIC_ACCESS,
|
| '''
|
| import 'libB.dart';
|
| @@ -567,13 +570,13 @@ main(B b) {
|
| ''');
|
| }
|
|
|
| - void test_createClass() {
|
| + test_createClass() async {
|
| resolveTestUnit('''
|
| main() {
|
| Test v = null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CLASS,
|
| '''
|
| main() {
|
| @@ -586,16 +589,16 @@ class Test {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['Test v =', 'Test {']);
|
| }
|
|
|
| - void test_createClass_BAD_hasUnresolvedPrefix() {
|
| + test_createClass_BAD_hasUnresolvedPrefix() async {
|
| resolveTestUnit('''
|
| main() {
|
| prefix.Test v = null;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_CLASS);
|
| + await assertNoFix(DartFixKind.CREATE_CLASS);
|
| }
|
|
|
| - void test_createClass_inLibraryOfPrefix() {
|
| + test_createClass_inLibraryOfPrefix() async {
|
| String libCode = r'''
|
| library my.lib;
|
|
|
| @@ -611,7 +614,7 @@ main() {
|
| }
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_CLASS, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_CLASS, error);
|
| change = fix.change;
|
| // apply to "lib.dart"
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -631,7 +634,7 @@ class Test {
|
| expect(change.linkedEditGroups, isEmpty);
|
| }
|
|
|
| - void test_createClass_innerLocalFunction() {
|
| + test_createClass_innerLocalFunction() async {
|
| resolveTestUnit('''
|
| f() {
|
| g() {
|
| @@ -639,7 +642,7 @@ f() {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CLASS,
|
| '''
|
| f() {
|
| @@ -654,13 +657,13 @@ class Test {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['Test v =', 'Test {']);
|
| }
|
|
|
| - void test_createClass_itemOfList() {
|
| + test_createClass_itemOfList() async {
|
| resolveTestUnit('''
|
| main() {
|
| var a = [Test];
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CLASS,
|
| '''
|
| main() {
|
| @@ -673,7 +676,7 @@ class Test {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['Test];', 'Test {']);
|
| }
|
|
|
| - void test_createClass_itemOfList_inAnnotation() {
|
| + test_createClass_itemOfList_inAnnotation() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER;
|
| };
|
| @@ -684,7 +687,7 @@ class MyAnnotation {
|
| @MyAnnotation(int, const [Test])
|
| main() {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CLASS,
|
| '''
|
| class MyAnnotation {
|
| @@ -699,7 +702,7 @@ class Test {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['Test])', 'Test {']);
|
| }
|
|
|
| - void test_createConstructor_forFinalFields() {
|
| + test_createConstructor_forFinalFields() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.message.contains("'a'");
|
| };
|
| @@ -710,7 +713,7 @@ class Test {
|
| final int c;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS,
|
| '''
|
| class Test {
|
| @@ -723,7 +726,7 @@ class Test {
|
| ''');
|
| }
|
|
|
| - void test_createConstructor_insteadOfSyntheticDefault() {
|
| + test_createConstructor_insteadOfSyntheticDefault() async {
|
| resolveTestUnit('''
|
| class A {
|
| int field;
|
| @@ -734,7 +737,7 @@ main() {
|
| new A(1, 2.0);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR,
|
| '''
|
| class A {
|
| @@ -751,7 +754,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createConstructor_named() {
|
| + test_createConstructor_named() async {
|
| resolveTestUnit('''
|
| class A {
|
| method() {}
|
| @@ -760,7 +763,7 @@ main() {
|
| new A.named(1, 2.0);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR,
|
| '''
|
| class A {
|
| @@ -776,23 +779,23 @@ main() {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['named(int ', 'named(1']);
|
| }
|
|
|
| - void test_createConstructorForFinalFields_inTopLevelMethod() {
|
| + test_createConstructorForFinalFields_inTopLevelMethod() async {
|
| resolveTestUnit('''
|
| main() {
|
| final int v;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
|
| + await assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
|
| }
|
|
|
| - void test_createConstructorForFinalFields_topLevelField() {
|
| + test_createConstructorForFinalFields_topLevelField() async {
|
| resolveTestUnit('''
|
| final int v;
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
|
| + await assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
|
| }
|
|
|
| - void test_createConstructorSuperExplicit() {
|
| + test_createConstructorSuperExplicit() async {
|
| resolveTestUnit('''
|
| class A {
|
| A(bool p1, int p2, double p3, String p4, {p5});
|
| @@ -801,7 +804,7 @@ class B extends A {
|
| B() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION,
|
| '''
|
| class A {
|
| @@ -813,7 +816,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperExplicit_hasInitializers() {
|
| + test_createConstructorSuperExplicit_hasInitializers() async {
|
| resolveTestUnit('''
|
| class A {
|
| A(int p);
|
| @@ -823,7 +826,7 @@ class B extends A {
|
| B() : field = 42 {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION,
|
| '''
|
| class A {
|
| @@ -836,7 +839,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperExplicit_named() {
|
| + test_createConstructorSuperExplicit_named() async {
|
| resolveTestUnit('''
|
| class A {
|
| A.named(int p);
|
| @@ -845,7 +848,7 @@ class B extends A {
|
| B() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION,
|
| '''
|
| class A {
|
| @@ -857,7 +860,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperExplicit_named_private() {
|
| + test_createConstructorSuperExplicit_named_private() async {
|
| resolveTestUnit('''
|
| class A {
|
| A._named(int p);
|
| @@ -866,10 +869,10 @@ class B extends A {
|
| B() {}
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
|
| + await assertNoFix(DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
|
| }
|
|
|
| - void test_createConstructorSuperExplicit_typeArgument() {
|
| + test_createConstructorSuperExplicit_typeArgument() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| A(T p);
|
| @@ -878,7 +881,7 @@ class B extends A<int> {
|
| B();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION,
|
| '''
|
| class A<T> {
|
| @@ -890,7 +893,7 @@ class B extends A<int> {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperImplicit() {
|
| + test_createConstructorSuperImplicit() async {
|
| resolveTestUnit('''
|
| class A {
|
| A(p1, int p2, List<String> p3, [int p4]);
|
| @@ -901,7 +904,7 @@ class B extends A {
|
| void existingMethod() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_SUPER,
|
| '''
|
| class A {
|
| @@ -917,7 +920,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperImplicit_fieldInitializer() {
|
| + test_createConstructorSuperImplicit_fieldInitializer() async {
|
| resolveTestUnit('''
|
| class A {
|
| int _field;
|
| @@ -929,7 +932,7 @@ class B extends A {
|
| void existingMethod() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_SUPER,
|
| '''
|
| class A {
|
| @@ -946,7 +949,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperImplicit_importType() {
|
| + test_createConstructorSuperImplicit_importType() async {
|
| addSource(
|
| '/libA.dart',
|
| r'''
|
| @@ -967,7 +970,7 @@ import 'libB.dart';
|
| class C extends B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_SUPER,
|
| '''
|
| import 'libB.dart';
|
| @@ -978,7 +981,7 @@ class C extends B {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperImplicit_named() {
|
| + test_createConstructorSuperImplicit_named() async {
|
| resolveTestUnit('''
|
| class A {
|
| A.named(p1, int p2);
|
| @@ -989,7 +992,7 @@ class B extends A {
|
| void existingMethod() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_SUPER,
|
| '''
|
| class A {
|
| @@ -1005,7 +1008,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createConstructorSuperImplicit_private() {
|
| + test_createConstructorSuperImplicit_private() async {
|
| resolveTestUnit('''
|
| class A {
|
| A._named(p);
|
| @@ -1013,10 +1016,10 @@ class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER);
|
| + await assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_SUPER);
|
| }
|
|
|
| - void test_createConstructorSuperImplicit_typeArgument() {
|
| + test_createConstructorSuperImplicit_typeArgument() async {
|
| resolveTestUnit('''
|
| class C<T> {
|
| final T x;
|
| @@ -1024,7 +1027,7 @@ class C<T> {
|
| }
|
| class D extends C<int> {
|
| }''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_CONSTRUCTOR_SUPER,
|
| '''
|
| class C<T> {
|
| @@ -1036,7 +1039,7 @@ class D extends C<int> {
|
| }''');
|
| }
|
|
|
| - void test_createField_BAD_inEnum() {
|
| + test_createField_BAD_inEnum() async {
|
| resolveTestUnit('''
|
| enum MyEnum {
|
| AAA, BBB
|
| @@ -1045,19 +1048,19 @@ main() {
|
| MyEnum.foo;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_FIELD);
|
| + await assertNoFix(DartFixKind.CREATE_FIELD);
|
| }
|
|
|
| - void test_createField_BAD_inSDK() {
|
| + test_createField_BAD_inSDK() async {
|
| resolveTestUnit('''
|
| main(List p) {
|
| p.foo = 1;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_FIELD);
|
| + await assertNoFix(DartFixKind.CREATE_FIELD);
|
| }
|
|
|
| - void test_createField_getter_multiLevel() {
|
| + test_createField_getter_multiLevel() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1071,7 +1074,7 @@ main(C c) {
|
| int v = c.b.a.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1089,7 +1092,7 @@ main(C c) {
|
| ''');
|
| }
|
|
|
| - void test_createField_getter_qualified_instance() {
|
| + test_createField_getter_qualified_instance() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1097,7 +1100,7 @@ main(A a) {
|
| int v = a.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1109,7 +1112,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createField_getter_qualified_instance_dynamicType() {
|
| + test_createField_getter_qualified_instance_dynamicType() async {
|
| resolveTestUnit('''
|
| class A {
|
| B b;
|
| @@ -1120,7 +1123,7 @@ class A {
|
| class B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1135,7 +1138,7 @@ class B {
|
| ''');
|
| }
|
|
|
| - void test_createField_getter_unqualified_instance_asInvocationArgument() {
|
| + test_createField_getter_unqualified_instance_asInvocationArgument() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1144,7 +1147,7 @@ class A {
|
| }
|
| f(String s) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1158,7 +1161,7 @@ f(String s) {}
|
| ''');
|
| }
|
|
|
| - void test_createField_getter_unqualified_instance_assignmentRhs() {
|
| + test_createField_getter_unqualified_instance_assignmentRhs() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1166,7 +1169,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1179,7 +1182,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createField_getter_unqualified_instance_asStatement() {
|
| + test_createField_getter_unqualified_instance_asStatement() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1187,7 +1190,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1200,7 +1203,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createField_hint() {
|
| + test_createField_hint() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1209,7 +1212,7 @@ main(A a) {
|
| int v = x.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1222,7 +1225,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createField_hint_setter() {
|
| + test_createField_hint_setter() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1231,7 +1234,7 @@ main(A a) {
|
| x.test = 0;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1244,7 +1247,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createField_importType() {
|
| + test_createField_importType() async {
|
| addSource(
|
| '/libA.dart',
|
| r'''
|
| @@ -1266,7 +1269,7 @@ main(C c) {
|
| c.test = getA();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| import 'libB.dart';
|
| @@ -1280,7 +1283,7 @@ main(C c) {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_generic_BAD() {
|
| + test_createField_setter_generic_BAD() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1291,7 +1294,7 @@ class B<T> {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1306,7 +1309,7 @@ class B<T> {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_generic_OK_local() {
|
| + test_createField_setter_generic_OK_local() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| List<T> items;
|
| @@ -1316,7 +1319,7 @@ class A<T> {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A<T> {
|
| @@ -1331,7 +1334,7 @@ class A<T> {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_qualified_instance_hasField() {
|
| + test_createField_setter_qualified_instance_hasField() async {
|
| resolveTestUnit('''
|
| class A {
|
| int aaa;
|
| @@ -1343,7 +1346,7 @@ main(A a) {
|
| a.test = 5;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1360,7 +1363,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_qualified_instance_hasMethod() {
|
| + test_createField_setter_qualified_instance_hasMethod() async {
|
| resolveTestUnit('''
|
| class A {
|
| existingMethod() {}
|
| @@ -1369,7 +1372,7 @@ main(A a) {
|
| a.test = 5;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1383,7 +1386,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_qualified_static() {
|
| + test_createField_setter_qualified_static() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1391,7 +1394,7 @@ main() {
|
| A.test = 5;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1403,7 +1406,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_unqualified_instance() {
|
| + test_createField_setter_unqualified_instance() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1411,7 +1414,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1424,7 +1427,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createField_setter_unqualified_static() {
|
| + test_createField_setter_unqualified_static() async {
|
| resolveTestUnit('''
|
| class A {
|
| static main() {
|
| @@ -1432,7 +1435,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FIELD,
|
| '''
|
| class A {
|
| @@ -1445,13 +1448,13 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createFile_forImport() {
|
| + test_createFile_forImport() async {
|
| testFile = '/my/project/bin/test.dart';
|
| resolveTestUnit('''
|
| import 'my_file.dart';
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| change = fix.change;
|
| // validate change
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -1463,7 +1466,7 @@ import 'my_file.dart';
|
| expect(fileEdit.edits[0].replacement, contains('library my_file;'));
|
| }
|
|
|
| - void test_createFile_forImport_inPackage_lib() {
|
| + test_createFile_forImport_inPackage_lib() async {
|
| provider.newFile('/projects/my_package/pubspec.yaml', 'name: my_package');
|
| testFile = '/projects/my_package/lib/test.dart';
|
| provider.newFolder('/projects/my_package/lib');
|
| @@ -1471,7 +1474,7 @@ import 'my_file.dart';
|
| import 'a/bb/c_cc/my_lib.dart';
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| change = fix.change;
|
| // validate change
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -1484,14 +1487,14 @@ import 'a/bb/c_cc/my_lib.dart';
|
| contains('library my_package.a.bb.c_cc.my_lib;'));
|
| }
|
|
|
| - void test_createFile_forImport_inPackage_test() {
|
| + test_createFile_forImport_inPackage_test() async {
|
| provider.newFile('/projects/my_package/pubspec.yaml', 'name: my_package');
|
| testFile = '/projects/my_package/test/misc/test_all.dart';
|
| resolveTestUnit('''
|
| import 'a/bb/my_lib.dart';
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| change = fix.change;
|
| // validate change
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -1504,14 +1507,14 @@ import 'a/bb/my_lib.dart';
|
| contains('library my_package.test.misc.a.bb.my_lib;'));
|
| }
|
|
|
| - void test_createFile_forPart() {
|
| + test_createFile_forPart() async {
|
| testFile = '/my/project/bin/test.dart';
|
| resolveTestUnit('''
|
| library my.lib;
|
| part 'my_part.dart';
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| change = fix.change;
|
| // validate change
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -1523,7 +1526,7 @@ part 'my_part.dart';
|
| expect(fileEdit.edits[0].replacement, contains('part of my.lib;'));
|
| }
|
|
|
| - void test_createFile_forPart_inPackageLib() {
|
| + test_createFile_forPart_inPackageLib() async {
|
| provider.newFile(
|
| '/my/pubspec.yaml',
|
| r'''
|
| @@ -1545,7 +1548,7 @@ part 'my_part.dart';
|
| // prepare fix
|
| testUnit = resolveLibraryUnit(testSource);
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
|
| change = fix.change;
|
| // validate change
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -1557,16 +1560,16 @@ part 'my_part.dart';
|
| expect(fileEdit.edits[0].replacement, contains('part of my.lib;'));
|
| }
|
|
|
| - void test_createGetter_BAD_inSDK() {
|
| + test_createGetter_BAD_inSDK() async {
|
| resolveTestUnit('''
|
| main(List p) {
|
| int v = p.foo;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_GETTER);
|
| + await assertNoFix(DartFixKind.CREATE_GETTER);
|
| }
|
|
|
| - void test_createGetter_hint_getter() {
|
| + test_createGetter_hint_getter() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1575,7 +1578,7 @@ main(A a) {
|
| int v = x.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1588,7 +1591,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_location_afterLastGetter() {
|
| + test_createGetter_location_afterLastGetter() async {
|
| resolveTestUnit('''
|
| class A {
|
| int existingField;
|
| @@ -1601,7 +1604,7 @@ main(A a) {
|
| int v = a.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1619,7 +1622,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_multiLevel() {
|
| + test_createGetter_multiLevel() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1633,7 +1636,7 @@ main(C c) {
|
| int v = c.b.a.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1651,7 +1654,7 @@ main(C c) {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_qualified_instance() {
|
| + test_createGetter_qualified_instance() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1659,7 +1662,7 @@ main(A a) {
|
| int v = a.test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1671,7 +1674,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_qualified_instance_dynamicType() {
|
| + test_createGetter_qualified_instance_dynamicType() async {
|
| resolveTestUnit('''
|
| class A {
|
| B b;
|
| @@ -1682,7 +1685,7 @@ class A {
|
| class B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1697,7 +1700,7 @@ class B {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_setterContext() {
|
| + test_createGetter_setterContext() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -1705,10 +1708,10 @@ main(A a) {
|
| a.test = 42;
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_GETTER);
|
| + await assertNoFix(DartFixKind.CREATE_GETTER);
|
| }
|
|
|
| - void test_createGetter_unqualified_instance_asInvocationArgument() {
|
| + test_createGetter_unqualified_instance_asInvocationArgument() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1717,7 +1720,7 @@ class A {
|
| }
|
| f(String s) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1731,7 +1734,7 @@ f(String s) {}
|
| ''');
|
| }
|
|
|
| - void test_createGetter_unqualified_instance_assignmentLhs() {
|
| + test_createGetter_unqualified_instance_assignmentLhs() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1739,10 +1742,10 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_GETTER);
|
| + await assertNoFix(DartFixKind.CREATE_GETTER);
|
| }
|
|
|
| - void test_createGetter_unqualified_instance_assignmentRhs() {
|
| + test_createGetter_unqualified_instance_assignmentRhs() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1750,7 +1753,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1763,7 +1766,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createGetter_unqualified_instance_asStatement() {
|
| + test_createGetter_unqualified_instance_asStatement() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -1771,7 +1774,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_GETTER,
|
| '''
|
| class A {
|
| @@ -1784,7 +1787,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_createLocalVariable_functionType_named() {
|
| + test_createLocalVariable_functionType_named() async {
|
| resolveTestUnit('''
|
| typedef MY_FUNCTION(int p);
|
| foo(MY_FUNCTION f) {}
|
| @@ -1792,7 +1795,7 @@ main() {
|
| foo(bar);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| typedef MY_FUNCTION(int p);
|
| @@ -1804,23 +1807,23 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createLocalVariable_functionType_synthetic() {
|
| + test_createLocalVariable_functionType_synthetic() async {
|
| resolveTestUnit('''
|
| foo(f(int p)) {}
|
| main() {
|
| foo(bar);
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_LOCAL_VARIABLE);
|
| + await assertNoFix(DartFixKind.CREATE_LOCAL_VARIABLE);
|
| }
|
|
|
| - void test_createLocalVariable_read_typeAssignment() {
|
| + test_createLocalVariable_read_typeAssignment() async {
|
| resolveTestUnit('''
|
| main() {
|
| int a = test;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1830,7 +1833,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createLocalVariable_read_typeCondition() {
|
| + test_createLocalVariable_read_typeCondition() async {
|
| resolveTestUnit('''
|
| main() {
|
| if (!test) {
|
| @@ -1838,7 +1841,7 @@ main() {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1850,14 +1853,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createLocalVariable_read_typeInvocationArgument() {
|
| + test_createLocalVariable_read_typeInvocationArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| f(test);
|
| }
|
| f(String p) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1870,13 +1873,13 @@ f(String p) {}
|
| _assertLinkedGroup(change.linkedEditGroups[1], ['test;', 'test);']);
|
| }
|
|
|
| - void test_createLocalVariable_read_typeInvocationTarget() {
|
| + test_createLocalVariable_read_typeInvocationTarget() async {
|
| resolveTestUnit('''
|
| main() {
|
| test.add('hello');
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1887,13 +1890,13 @@ main() {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['test;', 'test.add(']);
|
| }
|
|
|
| - void test_createLocalVariable_write_assignment() {
|
| + test_createLocalVariable_write_assignment() async {
|
| resolveTestUnit('''
|
| main() {
|
| test = 42;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1902,13 +1905,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createLocalVariable_write_assignment_compound() {
|
| + test_createLocalVariable_write_assignment_compound() async {
|
| resolveTestUnit('''
|
| main() {
|
| test += 42;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_LOCAL_VARIABLE,
|
| '''
|
| main() {
|
| @@ -1918,7 +1921,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_functionTypeAlias() {
|
| + test_createMissingOverrides_functionTypeAlias() async {
|
| resolveTestUnit('''
|
| typedef int Binary(int left, int right);
|
|
|
| @@ -1929,7 +1932,7 @@ abstract class Emulator {
|
| class MyEmulator extends Emulator {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| typedef int Binary(int left, int right);
|
| @@ -1947,7 +1950,7 @@ class MyEmulator extends Emulator {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_functionTypedParameter() {
|
| + test_createMissingOverrides_functionTypedParameter() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| forEach(int f(double p1, String p2));
|
| @@ -1956,7 +1959,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| abstract class A {
|
| @@ -1972,7 +1975,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_generics_typeArguments() {
|
| + test_createMissingOverrides_generics_typeArguments() async {
|
| resolveTestUnit('''
|
| class Iterator<T> {
|
| }
|
| @@ -1984,7 +1987,7 @@ abstract class IterableMixin<T> {
|
| class Test extends IterableMixin<int> {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| class Iterator<T> {
|
| @@ -2002,7 +2005,7 @@ class Test extends IterableMixin<int> {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_generics_typeParameters() {
|
| + test_createMissingOverrides_generics_typeParameters() async {
|
| resolveTestUnit('''
|
| abstract class ItemProvider<T> {
|
| List<T> getItems();
|
| @@ -2011,7 +2014,7 @@ abstract class ItemProvider<T> {
|
| class Test<V> extends ItemProvider<V> {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| abstract class ItemProvider<T> {
|
| @@ -2027,7 +2030,7 @@ class Test<V> extends ItemProvider<V> {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_getter() {
|
| + test_createMissingOverrides_getter() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| get g1;
|
| @@ -2037,7 +2040,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| abstract class A {
|
| @@ -2057,7 +2060,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_importPrefix() {
|
| + test_createMissingOverrides_importPrefix() async {
|
| resolveTestUnit('''
|
| import 'dart:async' as aaa;
|
| abstract class A {
|
| @@ -2067,7 +2070,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| import 'dart:async' as aaa;
|
| @@ -2084,7 +2087,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_mergeToField_getterSetter() {
|
| + test_createMissingOverrides_mergeToField_getterSetter() async {
|
| resolveTestUnit('''
|
| class A {
|
| int ma;
|
| @@ -2095,7 +2098,7 @@ class A {
|
| class B implements A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| class A {
|
| @@ -2117,7 +2120,7 @@ class B implements A {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_method() {
|
| + test_createMissingOverrides_method() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| m1();
|
| @@ -2173,7 +2176,7 @@ class B extends A {
|
| }
|
| }
|
| ''';
|
| - assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, expectedCode);
|
| + await assertHasFix(DartFixKind.CREATE_MISSING_OVERRIDES, expectedCode);
|
| // end position should be on "m1", not on "m2", "m3", etc
|
| {
|
| Position endPosition = change.selection;
|
| @@ -2190,7 +2193,7 @@ class B extends A {
|
| }
|
| }
|
|
|
| - void test_createMissingOverrides_operator() {
|
| + test_createMissingOverrides_operator() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| int operator [](int index);
|
| @@ -2200,7 +2203,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| abstract class A {
|
| @@ -2222,7 +2225,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createMissingOverrides_setter() {
|
| + test_createMissingOverrides_setter() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| set s1(x);
|
| @@ -2233,7 +2236,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_MISSING_OVERRIDES,
|
| '''
|
| abstract class A {
|
| @@ -2261,7 +2264,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_createNoSuchMethod() {
|
| + test_createNoSuchMethod() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| m1();
|
| @@ -2272,7 +2275,7 @@ class B extends A {
|
| existing() {}
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_NO_SUCH_METHOD,
|
| '''
|
| abstract class A {
|
| @@ -2288,7 +2291,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_cascadeSecond() {
|
| + test_creationFunction_forFunctionType_cascadeSecond() async {
|
| resolveTestUnit('''
|
| class A {
|
| B ma() => null;
|
| @@ -2302,7 +2305,7 @@ main() {
|
| a..ma().useFunction(test);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| class A {
|
| @@ -2322,14 +2325,14 @@ int test(double a, String b) {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_coreFunction() {
|
| + test_creationFunction_forFunctionType_coreFunction() async {
|
| resolveTestUnit('''
|
| main() {
|
| useFunction(g: test);
|
| }
|
| useFunction({Function g}) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -2342,14 +2345,14 @@ test() {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_dynamicArgument() {
|
| + test_creationFunction_forFunctionType_dynamicArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| useFunction(test);
|
| }
|
| useFunction(int g(a, b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -2362,14 +2365,14 @@ int test(a, b) {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_function() {
|
| + test_creationFunction_forFunctionType_function() async {
|
| resolveTestUnit('''
|
| main() {
|
| useFunction(test);
|
| }
|
| useFunction(int g(double a, String b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -2382,14 +2385,14 @@ int test(double a, String b) {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_function_namedArgument() {
|
| + test_creationFunction_forFunctionType_function_namedArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| useFunction(g: test);
|
| }
|
| useFunction({int g(double a, String b)}) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -2402,7 +2405,7 @@ int test(double a, String b) {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_importType() {
|
| + test_creationFunction_forFunctionType_importType() async {
|
| addSource(
|
| '/libA.dart',
|
| r'''
|
| @@ -2422,7 +2425,7 @@ main() {
|
| useFunction(test);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| import 'libB.dart';
|
| @@ -2436,7 +2439,7 @@ int test(A a) {
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_method_enclosingClass_static() {
|
| + test_creationFunction_forFunctionType_method_enclosingClass_static() async {
|
| resolveTestUnit('''
|
| class A {
|
| static foo() {
|
| @@ -2445,7 +2448,7 @@ class A {
|
| }
|
| useFunction(int g(double a, String b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -2460,7 +2463,7 @@ useFunction(int g(double a, String b)) {}
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_method_enclosingClass_static2() {
|
| + test_creationFunction_forFunctionType_method_enclosingClass_static2() async {
|
| resolveTestUnit('''
|
| class A {
|
| var f;
|
| @@ -2468,7 +2471,7 @@ class A {
|
| }
|
| useFunction(int g(double a, String b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -2482,7 +2485,7 @@ useFunction(int g(double a, String b)) {}
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_method_targetClass() {
|
| + test_creationFunction_forFunctionType_method_targetClass() async {
|
| resolveTestUnit('''
|
| main(A a) {
|
| useFunction(a.test);
|
| @@ -2491,7 +2494,7 @@ class A {
|
| }
|
| useFunction(int g(double a, String b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| main(A a) {
|
| @@ -2505,7 +2508,7 @@ useFunction(int g(double a, String b)) {}
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_method_targetClass_hasOtherMember() {
|
| + test_creationFunction_forFunctionType_method_targetClass_hasOtherMember() async {
|
| resolveTestUnit('''
|
| main(A a) {
|
| useFunction(a.test);
|
| @@ -2515,7 +2518,7 @@ class A {
|
| }
|
| useFunction(int g(double a, String b)) {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| main(A a) {
|
| @@ -2531,7 +2534,7 @@ useFunction(int g(double a, String b)) {}
|
| ''');
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_notFunctionType() {
|
| + test_creationFunction_forFunctionType_notFunctionType() async {
|
| resolveTestUnit('''
|
| main(A a) {
|
| useFunction(a.test);
|
| @@ -2539,11 +2542,11 @@ main(A a) {
|
| typedef A();
|
| useFunction(g) {}
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_METHOD);
|
| - assertNoFix(DartFixKind.CREATE_FUNCTION);
|
| + await assertNoFix(DartFixKind.CREATE_METHOD);
|
| + await assertNoFix(DartFixKind.CREATE_FUNCTION);
|
| }
|
|
|
| - void test_creationFunction_forFunctionType_unknownTarget() {
|
| + test_creationFunction_forFunctionType_unknownTarget() async {
|
| resolveTestUnit('''
|
| main(A a) {
|
| useFunction(a.test);
|
| @@ -2552,16 +2555,16 @@ class A {
|
| }
|
| useFunction(g) {}
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_METHOD);
|
| + await assertNoFix(DartFixKind.CREATE_METHOD);
|
| }
|
|
|
| - void test_expectedToken_semicolon() {
|
| + test_expectedToken_semicolon() async {
|
| resolveTestUnit('''
|
| main() {
|
| print(0)
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.INSERT_SEMICOLON,
|
| '''
|
| main() {
|
| @@ -2570,7 +2573,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_illegalAsyncReturnType_asyncLibrary_import() {
|
| + test_illegalAsyncReturnType_asyncLibrary_import() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
|
| };
|
| @@ -2579,7 +2582,7 @@ library main;
|
| int main() async {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_RETURN_TYPE_FUTURE,
|
| '''
|
| library main;
|
| @@ -2589,7 +2592,7 @@ Future<int> main() async {
|
| ''');
|
| }
|
|
|
| - void test_illegalAsyncReturnType_asyncLibrary_usePrefix() {
|
| + test_illegalAsyncReturnType_asyncLibrary_usePrefix() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
|
| };
|
| @@ -2598,7 +2601,7 @@ import 'dart:async' as al;
|
| int main() async {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_RETURN_TYPE_FUTURE,
|
| '''
|
| import 'dart:async' as al;
|
| @@ -2607,7 +2610,7 @@ al.Future<int> main() async {
|
| ''');
|
| }
|
|
|
| - void test_illegalAsyncReturnType_complexTypeName() {
|
| + test_illegalAsyncReturnType_complexTypeName() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
|
| };
|
| @@ -2616,7 +2619,7 @@ import 'dart:async';
|
| List<int> main() async {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_RETURN_TYPE_FUTURE,
|
| '''
|
| import 'dart:async';
|
| @@ -2625,7 +2628,7 @@ Future<List<int>> main() async {
|
| ''');
|
| }
|
|
|
| - void test_illegalAsyncReturnType_void() {
|
| + test_illegalAsyncReturnType_void() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
|
| };
|
| @@ -2634,7 +2637,7 @@ import 'dart:async';
|
| void main() async {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_RETURN_TYPE_FUTURE,
|
| '''
|
| import 'dart:async';
|
| @@ -2643,7 +2646,7 @@ Future main() async {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryPackage_withClass() {
|
| + test_importLibraryPackage_withClass() async {
|
| _configureMyPkg('''
|
| library my_lib;
|
| class Test {}
|
| @@ -2655,7 +2658,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'package:my_pkg/my_lib.dart';
|
| @@ -2666,7 +2669,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withClass_annotation() {
|
| + test_importLibraryProject_withClass_annotation() async {
|
| addSource(
|
| '/lib.dart',
|
| '''
|
| @@ -2681,7 +2684,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2692,7 +2695,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() {
|
| + test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource(
|
| '/project/bin/a.dart',
|
| @@ -2715,7 +2718,7 @@ main () {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'b.dart' show Two;
|
| @@ -2727,7 +2730,7 @@ main () {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withClass_inParentFolder() {
|
| + test_importLibraryProject_withClass_inParentFolder() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource(
|
| '/project/lib.dart',
|
| @@ -2741,7 +2744,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import '../lib.dart';
|
| @@ -2752,7 +2755,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withClass_inRelativeFolder() {
|
| + test_importLibraryProject_withClass_inRelativeFolder() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource(
|
| '/project/lib/sub/folder/lib.dart',
|
| @@ -2766,7 +2769,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import '../lib/sub/folder/lib.dart';
|
| @@ -2777,7 +2780,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withClass_inSameFolder() {
|
| + test_importLibraryProject_withClass_inSameFolder() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource(
|
| '/project/bin/lib.dart',
|
| @@ -2791,7 +2794,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2802,7 +2805,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withFunction() {
|
| + test_importLibraryProject_withFunction() async {
|
| addSource(
|
| '/lib.dart',
|
| '''
|
| @@ -2815,7 +2818,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2826,7 +2829,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withFunction_unresolvedMethod() {
|
| + test_importLibraryProject_withFunction_unresolvedMethod() async {
|
| addSource(
|
| '/lib.dart',
|
| '''
|
| @@ -2841,7 +2844,7 @@ class A {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2854,7 +2857,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withFunctionTypeAlias() {
|
| + test_importLibraryProject_withFunctionTypeAlias() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource(
|
| '/project/bin/lib.dart',
|
| @@ -2868,7 +2871,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2879,7 +2882,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryProject_withTopLevelVariable() {
|
| + test_importLibraryProject_withTopLevelVariable() async {
|
| addSource(
|
| '/lib.dart',
|
| '''
|
| @@ -2892,7 +2895,7 @@ main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PROJECT,
|
| '''
|
| import 'lib.dart';
|
| @@ -2903,13 +2906,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_AsExpression() {
|
| + test_importLibrarySdk_withClass_AsExpression() async {
|
| resolveTestUnit('''
|
| main(p) {
|
| p as Future;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -2920,13 +2923,13 @@ main(p) {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_invocationTarget() {
|
| + test_importLibrarySdk_withClass_invocationTarget() async {
|
| resolveTestUnit('''
|
| main() {
|
| Future.wait(null);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -2937,13 +2940,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_IsExpression() {
|
| + test_importLibrarySdk_withClass_IsExpression() async {
|
| resolveTestUnit('''
|
| main(p) {
|
| p is Future;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -2954,14 +2957,14 @@ main(p) {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_itemOfList() {
|
| + test_importLibrarySdk_withClass_itemOfList() async {
|
| resolveTestUnit('''
|
| main() {
|
| var a = [Future];
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -2972,7 +2975,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_itemOfList_inAnnotation() {
|
| + test_importLibrarySdk_withClass_itemOfList_inAnnotation() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER;
|
| };
|
| @@ -2983,7 +2986,7 @@ class MyAnnotation {
|
| @MyAnnotation(int, const [Future])
|
| main() {}
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -2996,13 +2999,13 @@ main() {}
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_typeAnnotation() {
|
| + test_importLibrarySdk_withClass_typeAnnotation() async {
|
| resolveTestUnit('''
|
| main() {
|
| Future f = null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -3013,13 +3016,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_typeAnnotation_PrefixedIdentifier() {
|
| + test_importLibrarySdk_withClass_typeAnnotation_PrefixedIdentifier() async {
|
| resolveTestUnit('''
|
| main() {
|
| Future.wait;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -3030,13 +3033,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withClass_typeArgument() {
|
| + test_importLibrarySdk_withClass_typeArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| List<Future> futures = [];
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:async';
|
| @@ -3047,14 +3050,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withTopLevelVariable() {
|
| + test_importLibrarySdk_withTopLevelVariable() async {
|
| resolveTestUnit('''
|
| main() {
|
| print(PI);
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:math';
|
| @@ -3065,14 +3068,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibrarySdk_withTopLevelVariable_annotation() {
|
| + test_importLibrarySdk_withTopLevelVariable_annotation() async {
|
| resolveTestUnit('''
|
| @PI
|
| main() {
|
| }
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SDK,
|
| '''
|
| import 'dart:math';
|
| @@ -3083,7 +3086,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryShow() {
|
| + test_importLibraryShow() async {
|
| resolveTestUnit('''
|
| import 'dart:async' show Stream;
|
| main() {
|
| @@ -3091,7 +3094,7 @@ main() {
|
| Future f = null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_SHOW,
|
| '''
|
| import 'dart:async' show Future, Stream;
|
| @@ -3102,13 +3105,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_isNotNull() {
|
| + test_isNotNull() async {
|
| resolveTestUnit('''
|
| main(p) {
|
| p is! Null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.USE_NOT_EQ_NULL,
|
| '''
|
| main(p) {
|
| @@ -3117,13 +3120,13 @@ main(p) {
|
| ''');
|
| }
|
|
|
| - void test_isNull() {
|
| + test_isNull() async {
|
| resolveTestUnit('''
|
| main(p) {
|
| p is Null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.USE_EQ_EQ_NULL,
|
| '''
|
| main(p) {
|
| @@ -3132,13 +3135,13 @@ main(p) {
|
| ''');
|
| }
|
|
|
| - void test_makeEnclosingClassAbstract_declaresAbstractMethod() {
|
| + test_makeEnclosingClassAbstract_declaresAbstractMethod() async {
|
| resolveTestUnit('''
|
| class A {
|
| m();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.MAKE_CLASS_ABSTRACT,
|
| '''
|
| abstract class A {
|
| @@ -3147,7 +3150,7 @@ abstract class A {
|
| ''');
|
| }
|
|
|
| - void test_makeEnclosingClassAbstract_inheritsAbstractMethod() {
|
| + test_makeEnclosingClassAbstract_inheritsAbstractMethod() async {
|
| resolveTestUnit('''
|
| abstract class A {
|
| m();
|
| @@ -3155,7 +3158,7 @@ abstract class A {
|
| class B extends A {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.MAKE_CLASS_ABSTRACT,
|
| '''
|
| abstract class A {
|
| @@ -3166,18 +3169,18 @@ abstract class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_noException_1() {
|
| + test_noException_1() async {
|
| resolveTestUnit('''
|
| main(p) {
|
| p i s Null;
|
| }''');
|
| List<AnalysisError> errors = context.computeErrors(testSource);
|
| for (var error in errors) {
|
| - _computeFixes(error);
|
| + await _computeFixes(error);
|
| }
|
| }
|
|
|
| - void test_nonBoolCondition_addNotNull() {
|
| + test_nonBoolCondition_addNotNull() async {
|
| resolveTestUnit('''
|
| main(String p) {
|
| if (p) {
|
| @@ -3185,7 +3188,7 @@ main(String p) {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.ADD_NE_NULL,
|
| '''
|
| main(String p) {
|
| @@ -3196,7 +3199,7 @@ main(String p) {
|
| ''');
|
| }
|
|
|
| - void test_removeDeadCode_condition() {
|
| + test_removeDeadCode_condition() async {
|
| resolveTestUnit('''
|
| main(int p) {
|
| if (true || p > 5) {
|
| @@ -3204,7 +3207,7 @@ main(int p) {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_DEAD_CODE,
|
| '''
|
| main(int p) {
|
| @@ -3215,7 +3218,7 @@ main(int p) {
|
| ''');
|
| }
|
|
|
| - void test_removeDeadCode_statements_one() {
|
| + test_removeDeadCode_statements_one() async {
|
| resolveTestUnit('''
|
| int main() {
|
| print(0);
|
| @@ -3223,7 +3226,7 @@ int main() {
|
| print(1);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_DEAD_CODE,
|
| '''
|
| int main() {
|
| @@ -3233,7 +3236,7 @@ int main() {
|
| ''');
|
| }
|
|
|
| - void test_removeDeadCode_statements_two() {
|
| + test_removeDeadCode_statements_two() async {
|
| resolveTestUnit('''
|
| int main() {
|
| print(0);
|
| @@ -3242,7 +3245,7 @@ int main() {
|
| print(2);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_DEAD_CODE,
|
| '''
|
| int main() {
|
| @@ -3252,13 +3255,13 @@ int main() {
|
| ''');
|
| }
|
|
|
| - void test_removeParentheses_inGetterDeclaration() {
|
| + test_removeParentheses_inGetterDeclaration() async {
|
| resolveTestUnit('''
|
| class A {
|
| int get foo() => 0;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_PARAMETERS_IN_GETTER_DECLARATION,
|
| '''
|
| class A {
|
| @@ -3267,7 +3270,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_removeParentheses_inGetterInvocation() {
|
| + test_removeParentheses_inGetterInvocation() async {
|
| resolveTestUnit('''
|
| class A {
|
| int get foo => 0;
|
| @@ -3276,7 +3279,7 @@ main(A a) {
|
| a.foo();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_PARENTHESIS_IN_GETTER_INVOCATION,
|
| '''
|
| class A {
|
| @@ -3288,7 +3291,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_removeUnnecessaryCast_assignment() {
|
| + test_removeUnnecessaryCast_assignment() async {
|
| resolveTestUnit('''
|
| main(Object p) {
|
| if (p is String) {
|
| @@ -3296,7 +3299,7 @@ main(Object p) {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNNECESSARY_CAST,
|
| '''
|
| main(Object p) {
|
| @@ -3307,7 +3310,7 @@ main(Object p) {
|
| ''');
|
| }
|
|
|
| - void test_removeUnusedCatchClause() {
|
| + test_removeUnusedCatchClause() async {
|
| errorFilter = (AnalysisError error) => true;
|
| resolveTestUnit('''
|
| main() {
|
| @@ -3317,7 +3320,7 @@ main() {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNUSED_CATCH_CLAUSE,
|
| '''
|
| main() {
|
| @@ -3329,7 +3332,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_removeUnusedCatchStack() {
|
| + test_removeUnusedCatchStack() async {
|
| errorFilter = (AnalysisError error) => true;
|
| resolveTestUnit('''
|
| main() {
|
| @@ -3339,7 +3342,7 @@ main() {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNUSED_CATCH_STACK,
|
| '''
|
| main() {
|
| @@ -3351,13 +3354,13 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_removeUnusedImport() {
|
| + test_removeUnusedImport() async {
|
| resolveTestUnit('''
|
| import 'dart:math';
|
| main() {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNUSED_IMPORT,
|
| '''
|
| main() {
|
| @@ -3365,7 +3368,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_removeUnusedImport_anotherImportOnLine() {
|
| + test_removeUnusedImport_anotherImportOnLine() async {
|
| resolveTestUnit('''
|
| import 'dart:math'; import 'dart:async';
|
|
|
| @@ -3373,7 +3376,7 @@ main() {
|
| Future f;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNUSED_IMPORT,
|
| '''
|
| import 'dart:async';
|
| @@ -3384,14 +3387,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_removeUnusedImport_severalLines() {
|
| + test_removeUnusedImport_severalLines() async {
|
| resolveTestUnit('''
|
| import
|
| 'dart:math';
|
| main() {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REMOVE_UNUSED_IMPORT,
|
| '''
|
| main() {
|
| @@ -3399,34 +3402,34 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_replaceImportUri_inProject() {
|
| + test_replaceImportUri_inProject() async {
|
| testFile = '/project/bin/test.dart';
|
| addSource('/project/foo/bar/lib.dart', '');
|
| resolveTestUnit('''
|
| import 'no/matter/lib.dart';
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_IMPORT_URI,
|
| '''
|
| import '../foo/bar/lib.dart';
|
| ''');
|
| }
|
|
|
| - void test_replaceImportUri_package() {
|
| + test_replaceImportUri_package() async {
|
| _configureMyPkg('');
|
| resolveTestUnit('''
|
| import 'no/matter/my_lib.dart';
|
| ''');
|
| performAllAnalysisTasks();
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_IMPORT_URI,
|
| '''
|
| import 'package:my_pkg/my_lib.dart';
|
| ''');
|
| }
|
|
|
| - void test_replaceVarWithDynamic() {
|
| + test_replaceVarWithDynamic() async {
|
| errorFilter = (AnalysisError error) {
|
| return error.errorCode == ParserErrorCode.VAR_AS_TYPE_NAME;
|
| };
|
| @@ -3435,7 +3438,7 @@ class A {
|
| Map<String, var> m;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.REPLACE_VAR_WITH_DYNAMIC,
|
| '''
|
| class A {
|
| @@ -3444,14 +3447,14 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_replaceWithConstInstanceCreation() {
|
| + test_replaceWithConstInstanceCreation() async {
|
| resolveTestUnit('''
|
| class A {
|
| const A();
|
| }
|
| const a = new A();
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.USE_CONST,
|
| '''
|
| class A {
|
| @@ -3461,13 +3464,13 @@ const a = const A();
|
| ''');
|
| }
|
|
|
| - void test_undefinedClass_useSimilar_fromImport() {
|
| + test_undefinedClass_useSimilar_fromImport() async {
|
| resolveTestUnit('''
|
| main() {
|
| Stirng s = 'abc';
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| main() {
|
| @@ -3476,14 +3479,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedClass_useSimilar_fromThisLibrary() {
|
| + test_undefinedClass_useSimilar_fromThisLibrary() async {
|
| resolveTestUnit('''
|
| class MyClass {}
|
| main() {
|
| MyCalss v = null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class MyClass {}
|
| @@ -3493,14 +3496,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_dynamicArgument() {
|
| + test_undefinedFunction_create_dynamicArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| dynamic v;
|
| test(v);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3513,13 +3516,13 @@ void test(v) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_dynamicReturnType() {
|
| + test_undefinedFunction_create_dynamicReturnType() async {
|
| resolveTestUnit('''
|
| main() {
|
| dynamic v = test();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3531,13 +3534,13 @@ test() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_fromFunction() {
|
| + test_undefinedFunction_create_fromFunction() async {
|
| resolveTestUnit('''
|
| main() {
|
| int v = myUndefinedFunction(1, 2.0, '3');
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3549,7 +3552,7 @@ int myUndefinedFunction(int i, double d, String s) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_fromMethod() {
|
| + test_undefinedFunction_create_fromMethod() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -3557,7 +3560,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| class A {
|
| @@ -3571,7 +3574,7 @@ int myUndefinedFunction(int i, double d, String s) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_generic_BAD() {
|
| + test_undefinedFunction_create_generic_BAD() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| Map<int, T> items;
|
| @@ -3580,7 +3583,7 @@ class A<T> {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| class A<T> {
|
| @@ -3595,7 +3598,7 @@ void process(Map items) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_generic_OK() {
|
| + test_undefinedFunction_create_generic_OK() async {
|
| resolveTestUnit('''
|
| class A {
|
| List<int> items;
|
| @@ -3604,7 +3607,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| class A {
|
| @@ -3619,7 +3622,7 @@ void process(List<int> items) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_importType() {
|
| + test_undefinedFunction_create_importType() async {
|
| addSource(
|
| '/lib.dart',
|
| r'''
|
| @@ -3633,7 +3636,7 @@ main() {
|
| test(getFuture());
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| import 'lib.dart';
|
| @@ -3647,13 +3650,13 @@ void test(Future future) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_nullArgument() {
|
| + test_undefinedFunction_create_nullArgument() async {
|
| resolveTestUnit('''
|
| main() {
|
| test(null);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3665,29 +3668,31 @@ void test(arg0) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_bool_expressions() {
|
| - assert_undefinedFunction_create_returnType_bool("!test();");
|
| - assert_undefinedFunction_create_returnType_bool("b && test();");
|
| - assert_undefinedFunction_create_returnType_bool("test() && b;");
|
| - assert_undefinedFunction_create_returnType_bool("b || test();");
|
| - assert_undefinedFunction_create_returnType_bool("test() || b;");
|
| + test_undefinedFunction_create_returnType_bool_expressions() async {
|
| + await assert_undefinedFunction_create_returnType_bool("!test();");
|
| + await assert_undefinedFunction_create_returnType_bool("b && test();");
|
| + await assert_undefinedFunction_create_returnType_bool("test() && b;");
|
| + await assert_undefinedFunction_create_returnType_bool("b || test();");
|
| + await assert_undefinedFunction_create_returnType_bool("test() || b;");
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_bool_statements() {
|
| - assert_undefinedFunction_create_returnType_bool("assert ( test() );");
|
| - assert_undefinedFunction_create_returnType_bool("if ( test() ) {}");
|
| - assert_undefinedFunction_create_returnType_bool("while ( test() ) {}");
|
| - assert_undefinedFunction_create_returnType_bool("do {} while ( test() );");
|
| + test_undefinedFunction_create_returnType_bool_statements() async {
|
| + await assert_undefinedFunction_create_returnType_bool("assert ( test() );");
|
| + await assert_undefinedFunction_create_returnType_bool("if ( test() ) {}");
|
| + await assert_undefinedFunction_create_returnType_bool(
|
| + "while ( test() ) {}");
|
| + await assert_undefinedFunction_create_returnType_bool(
|
| + "do {} while ( test() );");
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromAssignment_eq() {
|
| + test_undefinedFunction_create_returnType_fromAssignment_eq() async {
|
| resolveTestUnit('''
|
| main() {
|
| int v;
|
| v = myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3700,14 +3705,14 @@ int myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromAssignment_plusEq() {
|
| + test_undefinedFunction_create_returnType_fromAssignment_plusEq() async {
|
| resolveTestUnit('''
|
| main() {
|
| int v;
|
| v += myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3720,13 +3725,13 @@ num myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromBinary_right() {
|
| + test_undefinedFunction_create_returnType_fromBinary_right() async {
|
| resolveTestUnit('''
|
| main() {
|
| 0 + myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3738,13 +3743,13 @@ num myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromInitializer() {
|
| + test_undefinedFunction_create_returnType_fromInitializer() async {
|
| resolveTestUnit('''
|
| main() {
|
| int v = myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3756,14 +3761,14 @@ int myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromInvocationArgument() {
|
| + test_undefinedFunction_create_returnType_fromInvocationArgument() async {
|
| resolveTestUnit('''
|
| foo(int p) {}
|
| main() {
|
| foo( myUndefinedFunction() );
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| foo(int p) {}
|
| @@ -3776,13 +3781,13 @@ int myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_fromReturn() {
|
| + test_undefinedFunction_create_returnType_fromReturn() async {
|
| resolveTestUnit('''
|
| int main() {
|
| return myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| int main() {
|
| @@ -3794,13 +3799,13 @@ int myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_create_returnType_void() {
|
| + test_undefinedFunction_create_returnType_void() async {
|
| resolveTestUnit('''
|
| main() {
|
| myUndefinedFunction();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_FUNCTION,
|
| '''
|
| main() {
|
| @@ -3812,13 +3817,13 @@ void myUndefinedFunction() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_useSimilar_fromImport() {
|
| + test_undefinedFunction_useSimilar_fromImport() async {
|
| resolveTestUnit('''
|
| main() {
|
| pritn(0);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| main() {
|
| @@ -3827,14 +3832,14 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedFunction_useSimilar_thisLibrary() {
|
| + test_undefinedFunction_useSimilar_thisLibrary() async {
|
| resolveTestUnit('''
|
| myFunction() {}
|
| main() {
|
| myFuntcion();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| myFunction() {}
|
| @@ -3844,7 +3849,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedGetter_useSimilar_hint() {
|
| + test_undefinedGetter_useSimilar_hint() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -3854,7 +3859,7 @@ main(A a) {
|
| print(x.myFild);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -3867,7 +3872,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedGetter_useSimilar_qualified() {
|
| + test_undefinedGetter_useSimilar_qualified() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -3876,7 +3881,7 @@ main(A a) {
|
| print(a.myFild);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -3888,7 +3893,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedGetter_useSimilar_qualified_static() {
|
| + test_undefinedGetter_useSimilar_qualified_static() async {
|
| resolveTestUnit('''
|
| class A {
|
| static int MY_NAME = 1;
|
| @@ -3897,7 +3902,7 @@ main() {
|
| A.MY_NAM;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -3909,7 +3914,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedGetter_useSimilar_unqualified() {
|
| + test_undefinedGetter_useSimilar_unqualified() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -3918,7 +3923,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -3930,16 +3935,16 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_create_BAD_inSDK() {
|
| + test_undefinedMethod_create_BAD_inSDK() async {
|
| resolveTestUnit('''
|
| main() {
|
| List.foo();
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_METHOD);
|
| + await assertNoFix(DartFixKind.CREATE_METHOD);
|
| }
|
|
|
| - void test_undefinedMethod_create_generic_BAD_argumentType() {
|
| + test_undefinedMethod_create_generic_BAD_argumentType() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| B b;
|
| @@ -3952,7 +3957,7 @@ class A<T> {
|
| class B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A<T> {
|
| @@ -3970,7 +3975,7 @@ class B {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_create_generic_BAD_returnType() {
|
| + test_undefinedMethod_create_generic_BAD_returnType() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| main() {
|
| @@ -3981,7 +3986,7 @@ class A<T> {
|
| class B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A<T> {
|
| @@ -3997,7 +4002,7 @@ class B {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_create_generic_OK_literal() {
|
| + test_undefinedMethod_create_generic_OK_literal() async {
|
| resolveTestUnit('''
|
| class A {
|
| B b;
|
| @@ -4010,7 +4015,7 @@ class A {
|
| class B {
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4028,7 +4033,7 @@ class B {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_create_generic_OK_local() {
|
| + test_undefinedMethod_create_generic_OK_local() async {
|
| resolveTestUnit('''
|
| class A<T> {
|
| List<T> items;
|
| @@ -4037,7 +4042,7 @@ class A<T> {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A<T> {
|
| @@ -4052,7 +4057,7 @@ class A<T> {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_createQualified_fromClass() {
|
| + test_undefinedMethod_createQualified_fromClass() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -4060,7 +4065,7 @@ main() {
|
| A.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4073,7 +4078,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_createQualified_fromClass_hasOtherMember() {
|
| + test_undefinedMethod_createQualified_fromClass_hasOtherMember() async {
|
| resolveTestUnit('''
|
| class A {
|
| foo() {}
|
| @@ -4082,7 +4087,7 @@ main() {
|
| A.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4097,7 +4102,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_createQualified_fromInstance() {
|
| + test_undefinedMethod_createQualified_fromInstance() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -4105,7 +4110,7 @@ main(A a) {
|
| a.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4118,26 +4123,26 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_createQualified_targetIsFunctionType() {
|
| + test_undefinedMethod_createQualified_targetIsFunctionType() async {
|
| resolveTestUnit('''
|
| typedef A();
|
| main() {
|
| A.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_METHOD);
|
| + await assertNoFix(DartFixKind.CREATE_METHOD);
|
| }
|
|
|
| - void test_undefinedMethod_createQualified_targetIsUnresolved() {
|
| + test_undefinedMethod_createQualified_targetIsUnresolved() async {
|
| resolveTestUnit('''
|
| main() {
|
| NoSuchClass.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CREATE_METHOD);
|
| + await assertNoFix(DartFixKind.CREATE_METHOD);
|
| }
|
|
|
| - void test_undefinedMethod_createUnqualified_parameters() {
|
| + test_undefinedMethod_createUnqualified_parameters() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -4145,7 +4150,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4183,7 +4188,7 @@ class A {
|
| _assertLinkedGroup(change.linkedEditGroups[index++], ['s)']);
|
| }
|
|
|
| - void test_undefinedMethod_createUnqualified_returnType() {
|
| + test_undefinedMethod_createUnqualified_returnType() async {
|
| resolveTestUnit('''
|
| class A {
|
| main() {
|
| @@ -4191,7 +4196,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4209,13 +4214,13 @@ class A {
|
| ['myUndefinedMethod();', 'myUndefinedMethod() {']);
|
| }
|
|
|
| - void test_undefinedMethod_createUnqualified_staticFromField() {
|
| + test_undefinedMethod_createUnqualified_staticFromField() async {
|
| resolveTestUnit('''
|
| class A {
|
| static var f = myUndefinedMethod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4227,7 +4232,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_createUnqualified_staticFromMethod() {
|
| + test_undefinedMethod_createUnqualified_staticFromMethod() async {
|
| resolveTestUnit('''
|
| class A {
|
| static main() {
|
| @@ -4235,7 +4240,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4249,7 +4254,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_hint_createQualified_fromInstance() {
|
| + test_undefinedMethod_hint_createQualified_fromInstance() async {
|
| resolveTestUnit('''
|
| class A {
|
| }
|
| @@ -4258,7 +4263,7 @@ main() {
|
| a.myUndefinedMethod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CREATE_METHOD,
|
| '''
|
| class A {
|
| @@ -4272,7 +4277,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_parameterType_differentPrefixInTargetUnit() {
|
| + test_undefinedMethod_parameterType_differentPrefixInTargetUnit() async {
|
| String code2 = r'''
|
| library test2;
|
| import 'test3.dart' as bbb;
|
| @@ -4295,7 +4300,7 @@ main(aaa.D d, aaa.E e) {
|
| }
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_METHOD, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_METHOD, error);
|
| change = fix.change;
|
| // apply to "test2.dart"
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -4315,7 +4320,7 @@ class D {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_parameterType_inTargetUnit() {
|
| + test_undefinedMethod_parameterType_inTargetUnit() async {
|
| String code2 = r'''
|
| library test2;
|
| class D {
|
| @@ -4331,7 +4336,7 @@ main(test2.D d, test2.E e) {
|
| }
|
| ''');
|
| AnalysisError error = _findErrorToFix();
|
| - fix = _assertHasFix(DartFixKind.CREATE_METHOD, error);
|
| + fix = await _assertHasFix(DartFixKind.CREATE_METHOD, error);
|
| change = fix.change;
|
| // apply to "test2.dart"
|
| List<SourceFileEdit> fileEdits = change.edits;
|
| @@ -4350,16 +4355,16 @@ class E {}
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_useSimilar_ignoreOperators() {
|
| + test_undefinedMethod_useSimilar_ignoreOperators() async {
|
| resolveTestUnit('''
|
| main(Object object) {
|
| object.then();
|
| }
|
| ''');
|
| - assertNoFix(DartFixKind.CHANGE_TO);
|
| + await assertNoFix(DartFixKind.CHANGE_TO);
|
| }
|
|
|
| - void test_undefinedMethod_useSimilar_qualified() {
|
| + test_undefinedMethod_useSimilar_qualified() async {
|
| resolveTestUnit('''
|
| class A {
|
| myMethod() {}
|
| @@ -4369,7 +4374,7 @@ main() {
|
| a.myMehtod();
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4382,7 +4387,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_useSimilar_unqualified_superClass() {
|
| + test_undefinedMethod_useSimilar_unqualified_superClass() async {
|
| resolveTestUnit('''
|
| class A {
|
| myMethod() {}
|
| @@ -4393,7 +4398,7 @@ class B extends A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4407,7 +4412,7 @@ class B extends A {
|
| ''');
|
| }
|
|
|
| - void test_undefinedMethod_useSimilar_unqualified_thisClass() {
|
| + test_undefinedMethod_useSimilar_unqualified_thisClass() async {
|
| resolveTestUnit('''
|
| class A {
|
| myMethod() {}
|
| @@ -4416,7 +4421,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4428,7 +4433,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_undefinedSetter_useSimilar_hint() {
|
| + test_undefinedSetter_useSimilar_hint() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -4438,7 +4443,7 @@ main(A a) {
|
| x.myFild = 42;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4451,7 +4456,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedSetter_useSimilar_qualified() {
|
| + test_undefinedSetter_useSimilar_qualified() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -4460,7 +4465,7 @@ main(A a) {
|
| a.myFild = 42;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4472,7 +4477,7 @@ main(A a) {
|
| ''');
|
| }
|
|
|
| - void test_undefinedSetter_useSimilar_unqualified() {
|
| + test_undefinedSetter_useSimilar_unqualified() async {
|
| resolveTestUnit('''
|
| class A {
|
| int myField;
|
| @@ -4481,7 +4486,7 @@ class A {
|
| }
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.CHANGE_TO,
|
| '''
|
| class A {
|
| @@ -4493,7 +4498,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - void test_useEffectiveIntegerDivision() {
|
| + test_useEffectiveIntegerDivision() async {
|
| resolveTestUnit('''
|
| main() {
|
| var a = 5;
|
| @@ -4501,7 +4506,7 @@ main() {
|
| print((a / b).toInt());
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.USE_EFFECTIVE_INTEGER_DIVISION,
|
| '''
|
| main() {
|
| @@ -4512,7 +4517,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_useImportPrefix_withClass() {
|
| + test_useImportPrefix_withClass() async {
|
| resolveTestUnit('''
|
| import 'dart:async' as pref;
|
| main() {
|
| @@ -4520,7 +4525,7 @@ main() {
|
| Future f = null;
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| '''
|
| import 'dart:async' as pref;
|
| @@ -4531,7 +4536,7 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_useImportPrefix_withTopLevelVariable() {
|
| + test_useImportPrefix_withTopLevelVariable() async {
|
| resolveTestUnit('''
|
| import 'dart:math' as pref;
|
| main() {
|
| @@ -4539,7 +4544,7 @@ main() {
|
| print(PI);
|
| }
|
| ''');
|
| - assertHasFix(
|
| + await assertHasFix(
|
| DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| '''
|
| import 'dart:math' as pref;
|
| @@ -4553,8 +4558,8 @@ main() {
|
| /**
|
| * Computes fixes and verifies that there is a fix of the given kind.
|
| */
|
| - Fix _assertHasFix(FixKind kind, AnalysisError error) {
|
| - List<Fix> fixes = _computeFixes(error);
|
| + Future<Fix> _assertHasFix(FixKind kind, AnalysisError error) async {
|
| + List<Fix> fixes = await _computeFixes(error);
|
| for (Fix fix in fixes) {
|
| if (fix.kind == kind) {
|
| return fix;
|
| @@ -4575,8 +4580,10 @@ main() {
|
| /**
|
| * Computes fixes for the given [error] in [testUnit].
|
| */
|
| - List<Fix> _computeFixes(AnalysisError error) {
|
| - FixProcessor processor = new FixProcessor(provider, testUnit, error);
|
| + Future<List<Fix>> _computeFixes(AnalysisError error) async {
|
| + DartFixContext dartContext = new DartFixContextImpl(
|
| + new FixContextImpl(provider, context, error), testUnit);
|
| + FixProcessor processor = new FixProcessor(dartContext);
|
| return processor.compute();
|
| }
|
|
|
|
|