a more pleasant-looking method type arguments presentation in lookup

This commit is contained in:
peter
2011-10-21 19:25:52 +02:00
parent 36cc99ea9a
commit 0ba592df62
3 changed files with 17 additions and 5 deletions
@@ -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();
@@ -0,0 +1,8 @@
import java.util.Map;
public class Foo {
Set<String> bar() {
Map<String, String> s = em<caret>
}
}
@@ -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);