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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java

Issue 11366078: Report error for deprecated #library #import #source (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java
index 22a18a604226c40b7d2a57d3eba77aaded82c167..d19c71614340ee0e3a082cd736b56a7bd2f09de2 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/rename/RenameImportProcessor.java
@@ -119,18 +119,18 @@ public class RenameImportProcessor extends RenameTopLevelProcessor {
CompilationUnit cu = imprt.getCompilationUnit();
String editName = RefactoringCoreMessages.RenameProcessor_update_declaration;
if (hasPrefix && willHavePrefix) {
- SourceRange nameRange = SourceRangeUtils.getExpanded(imprt.getNameRange(), -1);
+ SourceRange nameRange = imprt.getNameRange();
addTextEdit(cu, editName, createTextChange(nameRange));
} else if (!hasPrefix) {
SourceRange uriRange = imprt.getUriRange();
int uriEnd = SourceRangeUtils.getEnd(uriRange);
- addTextEdit(cu, editName, new ReplaceEdit(uriEnd, 0, ", prefix: '" + newName + "'"));
+ addTextEdit(cu, editName, new ReplaceEdit(uriEnd, 0, " as " + newName));
} else if (!willHavePrefix) {
SourceRange uriRange = imprt.getUriRange();
SourceRange sourceRange = imprt.getSourceRange();
int uriEnd = SourceRangeUtils.getEnd(uriRange);
int sourceEnd = SourceRangeUtils.getEnd(sourceRange);
- addTextEdit(cu, editName, new ReplaceEdit(uriEnd, sourceEnd - uriEnd, ");"));
+ addTextEdit(cu, editName, new ReplaceEdit(uriEnd, sourceEnd - uriEnd, ";"));
}
}

Powered by Google App Engine
This is Rietveld 408576698