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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java

Issue 10962014: Fixes for raw string and block clean ups (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java
index ce5363e3f147b3689041d17f6781c27ebcde12d6..869d8b4219a22e35c37f44979791c87f21eb3cd3 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/cleanup/migration/Migrate_1M1_rawString_CleanUp.java
@@ -17,6 +17,8 @@ import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartStringLiteral;
import com.google.dart.tools.core.utilities.general.SourceRangeFactory;
+import java.util.List;
+
/**
* In specification 1.0 M1 raw string should start with 'r'.
*
@@ -28,9 +30,12 @@ public class Migrate_1M1_rawString_CleanUp extends AbstractMigrateCleanUp {
unitNode.accept(new ASTVisitor<Void>() {
@Override
public Void visitStringLiteral(DartStringLiteral node) {
- String source = utils.getText(node);
- if (source.startsWith("@")) {
- addReplaceEdit(SourceRangeFactory.forStartLength(node, 1), "r");
+ List<DartStringLiteral> parts = node.getParts();
+ for (DartStringLiteral part : parts) {
+ String source = utils.getText(part);
+ if (source.startsWith("@")) {
+ addReplaceEdit(SourceRangeFactory.forStartLength(part, 1), "r");
+ }
}
return null;
}

Powered by Google App Engine
This is Rietveld 408576698