mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-89056 Strange 'xxx[]' item is shown in smart completion list
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import java.util.List;
|
||||
|
||||
class A {
|
||||
public static <T> List<T> asList(T... a) { }
|
||||
|
||||
List<String> m() {
|
||||
return asList(new <caret>);
|
||||
}
|
||||
}
|
||||
+9
-3
@@ -6,7 +6,6 @@ import com.intellij.codeInsight.completion.impl.CamelHumpMatcher;
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElementPresentation;
|
||||
import com.intellij.codeInsight.lookup.PsiTypeLookupItem;
|
||||
import com.intellij.codeInsight.template.SmartCompletionContextType;
|
||||
import com.intellij.codeInsight.template.Template;
|
||||
import com.intellij.codeInsight.template.TemplateContextType;
|
||||
@@ -602,8 +601,15 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
public void testNewVararg() throws Throwable {
|
||||
configureByTestName();
|
||||
assertStringItems("Foo", "Foo");
|
||||
assertEquals(0, myItems[0].as(PsiTypeLookupItem.class).getBracketsCount());
|
||||
assertEquals(1, myItems[1].as(PsiTypeLookupItem.class).getBracketsCount());
|
||||
assertEquals("{...} (default package)", LookupElementPresentation.renderElement(myItems[0]).getTailText());
|
||||
assertEquals("[] (default package)", LookupElementPresentation.renderElement(myItems[1]).getTailText());
|
||||
}
|
||||
|
||||
public void testNewVararg2() throws Throwable {
|
||||
configureByTestName();
|
||||
assertStringItems("String", "String");
|
||||
assertEquals(" (java.lang)", LookupElementPresentation.renderElement(myItems[0]).getTailText());
|
||||
assertEquals("[] (java.lang)", LookupElementPresentation.renderElement(myItems[1]).getTailText());
|
||||
}
|
||||
|
||||
public void testInsideStringLiteral() throws Throwable { doAntiTest(); }
|
||||
|
||||
Reference in New Issue
Block a user