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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java

Issue 10501008: Infer types using 'v is! Type' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for comments Created 8 years, 7 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.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java
index 4e53196b31a62be294144d7d64cdc2ef2d9094d4..5652c51d8d0da488751f61068442bda49446b590 100644
--- a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java
+++ b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionSpec.java
@@ -38,8 +38,9 @@ class CompletionSpec {
static Collection<CompletionSpec> from(String originalSource, String[] validationStrings) {
Map<Character, CompletionSpec> tests = new HashMap<Character, CompletionSpec>();
String modifiedSource = originalSource;
+ int modifiedPosition = 0;
while (true) {
- int index = modifiedSource.indexOf('!');
+ int index = modifiedSource.indexOf('!', modifiedPosition);
if (index < 0) {
break;
}
@@ -50,6 +51,8 @@ class CompletionSpec {
CompletionSpec test = new CompletionSpec(id);
tests.put(id, test);
test.completionPoint = index;
+ } else {
+ modifiedPosition = index + 1;
}
modifiedSource = modifiedSource.substring(0, index) + modifiedSource.substring(index + n);
}
@@ -65,7 +68,7 @@ class CompletionSpec {
String value = result.substring(2);
CompletionSpec test = tests.get(id);
if (test == null) {
- throw new IllegalStateException("Invliad completion result id: " + id + " for: " + result);
+ throw new IllegalStateException("Invalid completion result id: " + id + " for: " + result);
}
test.source = modifiedSource;
if (sign == '+') {
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionEngineTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698