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

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

Issue 1492843003: Don't attempt to create a file for non-Dart imports. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4a6b1f9fff3a5bc242b2be3ec54f0206cac89a70..eba635ff26ffc439c35e353eef55e1e949635319 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1096,7 +1096,7 @@ class FixProcessor {
Source source = importDirective.source;
if (source != null) {
String file = source.fullName;
- if (isAbsolute(file)) {
+ if (isAbsolute(file) && AnalysisEngine.isDartFileName(file)) {
String libName = _computeLibraryName(file);
SourceEdit edit = new SourceEdit(0, 0, 'library $libName;$eol$eol');
doSourceChange_addSourceEdit(change, context, source, edit);
@@ -2376,7 +2376,7 @@ class FixProcessor {
if (relPathParts[0].toLowerCase() == 'lib') {
relPathParts.removeAt(0);
}
- {
+ if (relPathParts.isNotEmpty) {
String nameWithoutExt = pathContext.withoutExtension(relPathParts.last);
relPathParts[relPathParts.length - 1] = nameWithoutExt;
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698