IDEA-50590 When completing a field with qualifier casting, caret is placed inside typecast

This commit is contained in:
peter.gromov
2010-11-26 13:02:04 +03:00
parent 6e59c41457
commit 19943e9543
4 changed files with 21 additions and 0 deletions
@@ -687,6 +687,7 @@ public class JavaCompletionUtil {
document.insertString(exprStart, prefix + spaceWithin + ")" + spaceAfter);
CompletionUtil.emulateInsertion(context, exprStart + prefix.length(), to);
context.getEditor().getCaretModel().moveToOffset(context.getTailOffset());
}
}
@@ -0,0 +1,9 @@
public class TestClass {
int abc;
public TestClass create(Object o) {
if (o instanceof TestClass) {
o.ab<caret>
}
}
}
@@ -0,0 +1,9 @@
public class TestClass {
int abc;
public TestClass create(Object o) {
if (o instanceof TestClass) {
((TestClass) o).abc<caret>
}
}
}
@@ -454,6 +454,8 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
doTest();
}
public void testFieldWithCastingCaret() throws Throwable { doTest(); }
public void testMethodReturnType() throws Throwable {
doTest();
}