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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 2226613004: Suppress follow-on errors when a file is imported with either a prefix or a show clause (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cache URI existence in a modifier' Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4daa06eb09ba3013ab2dc557f413a76d42454206..27f33c847c85d956f1825b3a421855f2ffc9b777 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -624,13 +624,16 @@ class FixProcessor {
} else {
for (ImportElement import in unitLibraryElement.imports) {
if (prefixElement is PrefixElement && import.prefix == prefixElement) {
- targetUnit = import.importedLibrary.definingCompilationUnit;
- Source targetSource = targetUnit.source;
- int offset = targetSource.contents.data.length;
- sb = new SourceBuilder(targetSource.fullName, offset);
- prefix = '$eol';
- suffix = '$eol';
- break;
+ LibraryElement library = import.importedLibrary;
+ if (library != null) {
+ targetUnit = library.definingCompilationUnit;
+ Source targetSource = targetUnit.source;
+ int offset = targetSource.contents.data.length;
+ sb = new SourceBuilder(targetSource.fullName, offset);
+ prefix = '$eol';
+ suffix = '$eol';
+ break;
+ }
}
}
if (sb == null) {
@@ -1283,6 +1286,7 @@ class FixProcessor {
}
isFirst = false;
}
+
// merge getter/setter pairs into fields
String prefix = utils.getIndent(1);
for (int i = 0; i < elements.length; i++) {

Powered by Google App Engine
This is Rietveld 408576698