diff --git a/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java b/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java index c64a221a0d6c..9e89d7ac0126 100644 --- a/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java +++ b/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java @@ -275,6 +275,9 @@ public class PsiTypeLookupItem extends LookupItem { presentation.setItemText(((PsiType)object).getCanonicalText()); presentation.setItemTextBold(getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null || object instanceof PsiPrimitiveType); + if (isAddArrayInitializer()) { + presentation.setTailText("{...}"); + } } if (myBracketsCount > 0) { diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewByteArray2.java b/java/java-tests/testData/codeInsight/completion/smartType/NewByteArray2.java new file mode 100644 index 000000000000..646b1081aa1e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewByteArray2.java @@ -0,0 +1,10 @@ +public class Bug17 { + + private void f(byte[] d) { + } + + private void g() { + f(new ); + } + +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java index a8fc06a8faad..ed7e90dd5957 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java @@ -613,7 +613,13 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase { configureByTestName(); assertStringItems("byte"); assertEquals("[]", LookupElementPresentation.renderElement(myItems[0]).getTailText()); + } + public void testNewByteArray2() { + configureByTestName(); + assertStringItems("byte", "byte"); + assertEquals("[]", LookupElementPresentation.renderElement(myItems[0]).getTailText()); + assertEquals("[]{...}", LookupElementPresentation.renderElement(myItems[1]).getTailText()); } public void testInsideStringLiteral() throws Throwable { doAntiTest(); }