Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
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 716b2de1a80c2ddce9d0ae64dba2cdfc9a5ed938..f0e6bda118c4c6d31b078fe9720d2d6ade06cfe6 100644 |
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
@@ -105,7 +105,7 @@ class FixProcessor { |
final LinkedHashMap<String, LinkedEditGroup> linkedPositionGroups = |
new LinkedHashMap<String, LinkedEditGroup>(); |
Position exitPosition = null; |
- Set<LibraryElement> librariesToImport = new Set<LibraryElement>(); |
+ Set<SourceInfo> librariesToImport = new Set<SourceInfo>(); |
CorrectionUtils utils; |
int errorOffset; |
@@ -1453,10 +1453,9 @@ class FixProcessor { |
_addFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, []); |
} |
- void _addFix_importLibrary(FixKind kind, LibraryElement libraryElement) { |
- librariesToImport.add(libraryElement); |
- Source librarySource = libraryElement.source; |
- String libraryUri = getLibrarySourceUri(unitLibraryElement, librarySource); |
+ void _addFix_importLibrary(FixKind kind, SourceInfo library) { |
+ librariesToImport.add(library); |
+ String libraryUri = getLibrarySourceUri(unitLibraryElement, library); |
_addFix(kind, [libraryUri], importsOnly: true); |
} |
@@ -1544,7 +1543,10 @@ class FixProcessor { |
continue; |
} |
// add import |
- _addFix_importLibrary(DartFixKind.IMPORT_LIBRARY_SDK, libraryElement); |
+ _addFix_importLibrary( |
+ DartFixKind.IMPORT_LIBRARY_SDK, |
+ new SourceInfo( |
+ libraryElement.source.fullName, libraryElement.source.uri)); |
} |
} |
// check project libraries |
@@ -1591,7 +1593,10 @@ class FixProcessor { |
fixKind = DartFixKind.IMPORT_LIBRARY_PROJECT1; |
} |
// Add the fix. |
- _addFix_importLibrary(fixKind, libraryElement); |
+ _addFix_importLibrary( |
+ fixKind, |
+ new SourceInfo( |
+ libraryElement.source.fullName, libraryElement.source.uri)); |
} |
} |
} |