IDEA-169780 Show parameter types in implement/override popup

This commit is contained in:
peter
2017-03-20 13:32:19 +01:00
parent 2ef1a4bffb
commit 09d6f71387
3 changed files with 6 additions and 4 deletions
@@ -162,7 +162,9 @@ public class JavaGenerateMemberCompletionContributor {
PsiType type = substitutor.substitute(prototype.getReturnType());
String signature = modifiers + (type == null ? "" : type.getPresentableText() + " ") + methodName;
String parameters = PsiFormatUtil.formatMethod(prototype, substitutor, PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase.SHOW_NAME);
String parameters = PsiFormatUtil.formatMethod(prototype, substitutor,
PsiFormatUtilBase.SHOW_PARAMETERS,
PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_RAW_TYPE | PsiFormatUtilBase.SHOW_TYPE);
String overrideSignature = " @Override " + signature; // leading space to make it a middle match, under all annotation suggestions
LookupElementBuilder element = LookupElementBuilder.create(prototype, signature).withLookupString(methodName).
@@ -1,7 +1,7 @@
class Super {
void foo1() {}
@Deprecated
void foo2() {}
void foo2(int x) {}
}
class Sub extends Super {
@@ -1514,7 +1514,7 @@ class XInternalError {}
def p = LookupElementPresentation.renderElement(item)
assert p.itemText == 'public void run'
assert p.tailText == '(t, myInt) {...}'
assert p.tailText == '(String t, int myInt) {...}'
assert p.typeText == 'Foo'
lookup.currentItem = item
@@ -1552,7 +1552,7 @@ class XInternalError {}
p = LookupElementPresentation.renderElement(setter)
assert p.itemText == setter.lookupString
assert p.tailText == '(field) {...}'
assert p.tailText == '(int field) {...}'
assert !p.typeText
lookup.currentItem = getter