diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart index cf8676db313..1b83ef5b643 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart @@ -922,7 +922,6 @@ class FixProcessor { String libName = removeEnd(source.shortName, '.dart'); libName = libName.replaceAll('_', '.'); SourceEdit edit = new SourceEdit(0, 0, 'library $libName;$eol$eol'); - change.addEdit(file, -1, edit); doSourceChange_addSourceEdit(change, context, source, edit); } _addFix(DartFixKind.CREATE_FILE, [file]); @@ -1127,7 +1126,6 @@ class FixProcessor { String file = source.fullName; String libName = unitLibraryElement.name; SourceEdit edit = new SourceEdit(0, 0, 'part of $libName;$eol$eol'); - change.addEdit(file, -1, edit); doSourceChange_addSourceEdit(change, context, source, edit); _addFix(DartFixKind.CREATE_FILE, [file]); } diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart index 1b4af7d502d..f09f8c6f742 100644 --- a/pkg/analysis_server/test/services/correction/fix_test.dart +++ b/pkg/analysis_server/test/services/correction/fix_test.dart @@ -1055,6 +1055,7 @@ import 'my_file.dart'; SourceFileEdit fileEdit = change.edits[0]; expect(fileEdit.file, '/my/project/bin/my_file.dart'); expect(fileEdit.fileStamp, -1); + expect(fileEdit.edits, hasLength(1)); expect(fileEdit.edits[0].replacement, contains('library my.file;')); } @@ -1073,6 +1074,7 @@ part 'my_part.dart'; SourceFileEdit fileEdit = change.edits[0]; expect(fileEdit.file, '/my/project/bin/my_part.dart'); expect(fileEdit.fileStamp, -1); + expect(fileEdit.edits, hasLength(1)); expect(fileEdit.edits[0].replacement, contains('part of my.lib;')); }