IDEA-108068 Idea suggests two identical completions for an array constructor

This commit is contained in:
peter
2013-05-29 19:43:36 +02:00
parent 7053313c86
commit f60d51bff6
3 changed files with 19 additions and 0 deletions
@@ -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) {
@@ -0,0 +1,10 @@
public class Bug17 {
private void f(byte[] d) {
}
private void g() {
f(new <caret>);
}
}
@@ -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(); }