mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
a more pleasant-looking method type arguments presentation in lookup
This commit is contained in:
@@ -235,7 +235,7 @@ public class JavaMethodCallElement extends LookupItem<PsiMethod> implements Type
|
||||
String typeParamsText = getTypeParamsText(true);
|
||||
if (typeParamsText != null) {
|
||||
if (typeParamsText.length() > 10) {
|
||||
typeParamsText = typeParamsText.substring(0, 10) + "...";
|
||||
typeParamsText = typeParamsText.substring(0, 10) + "...>";
|
||||
}
|
||||
|
||||
String itemText = presentation.getItemText();
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.Map;
|
||||
|
||||
public class Foo {
|
||||
|
||||
Set<String> bar() {
|
||||
Map<String, String> s = em<caret>
|
||||
}
|
||||
}
|
||||
+8
-4
@@ -2,10 +2,7 @@ package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.CodeInsightSettings;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElementDecorator;
|
||||
import com.intellij.codeInsight.lookup.LookupItem;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.lookup.*;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -193,6 +190,13 @@ public class SecondSmartTypeCompletionTest extends LightCompletionTestCase {
|
||||
checkResult();
|
||||
}
|
||||
|
||||
public void testEmptyMapPresentation() {
|
||||
configure();
|
||||
LookupElementPresentation presentation = new LookupElementPresentation();
|
||||
myItems[0].renderElement(presentation);
|
||||
assertEquals("Collections.<String, S...>emptyMap", presentation.getItemText());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void complete() {
|
||||
complete(2);
|
||||
|
||||
Reference in New Issue
Block a user