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

Unified Diff: editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java

Issue 293743003: Issue 18863. Quick fix for "create method" should work with hints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java b/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java
index df8d63f8069d0ca4e428c54d499297d12e580221..375ccc7349c04b15128566ecd21de6f10b8d50d1 100644
--- a/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java
+++ b/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImplTest.java
@@ -2065,6 +2065,39 @@ public class QuickFixProcessorImplTest extends RefactoringImplTest {
"}"));
}
+ public void test_undefinedMethod_hint_createQualified_fromInstance() throws Exception {
+ enableContextHints();
+ prepareProblemWithFix(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ "}",
+ "main() {",
+ " var a = new A();",
+ " a.myUndefinedMethod();",
+ "}",
+ "");
+ assert_runProcessor(
+ CorrectionKind.QF_CREATE_METHOD,
+ makeSource(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " void myUndefinedMethod() {",
+ " }",
+ "}",
+ "main() {",
+ " var a = new A();",
+ " a.myUndefinedMethod();",
+ "}",
+ ""));
+ // linked positions
+ {
+ Map<String, List<SourceRange>> expected = Maps.newHashMap();
+ expected.put("NAME", getResultRanges("myUndefinedMethod();", "myUndefinedMethod() {"));
+ expected.put("RETURN_TYPE", getResultRanges("void myUndefinedMethod()"));
+ assertEquals(expected, resultProposal.getLinkedPositions());
+ }
+ }
+
public void test_undefinedMethod_useSimilar_qualified() throws Exception {
prepareProblemWithFix(
"// filler filler filler filler filler filler filler filler filler filler",
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickFixProcessorImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698