correctly treat accepting "new int[]" with [ (IDEA-70002)

This commit is contained in:
peter
2011-05-23 14:24:37 +02:00
parent 2401e665fe
commit ab06d12a17
4 changed files with 15 additions and 0 deletions
@@ -58,6 +58,9 @@ public class PsiTypeLookupItem extends LookupItem {
if (!braces.isEmpty()) {
context.getDocument().insertString(tail, braces);
editor.getCaretModel().moveToOffset(tail + 1);
if (context.getCompletionChar() == '[') {
context.setAddCompletionChar(false);
}
} else {
editor.getCaretModel().moveToOffset(tail);
}
@@ -0,0 +1,5 @@
public class Bar {
{
int[] a = new in<caret>
}
}
@@ -0,0 +1,5 @@
public class Bar {
{
int[] a = new int[<caret>]
}
}
@@ -919,6 +919,8 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
doTest '\n'
}
public void testPrimitiveArrayWithRBrace() throws Throwable { doTest '[' }
public void testSuggestMembersOfStaticallyImportedClasses() throws Exception {
myFixture.addClass("""package foo;
public class Foo {