IDEA-158416 Deprecated methods are not striked through in implements/override completion

This commit is contained in:
peter
2016-07-25 19:42:49 +02:00
parent 74e2f13697
commit 45b1fe1515
3 changed files with 19 additions and 0 deletions
@@ -168,6 +168,9 @@ public class JavaGenerateMemberCompletionContributor {
LookupElementBuilder element = LookupElementBuilder.create(prototype, signature).withLookupString(methodName).
withLookupString(signature).withLookupString(overrideSignature).withInsertHandler(insertHandler).
appendTailText(parameters, false).appendTailText(" {...}", true).withTypeText(typeText).withIcon(icon);
if (prototype.isDeprecated()) {
element = element.setStrikeout(true);
}
element.putUserData(GENERATE_ELEMENT, true);
return element;
}
@@ -0,0 +1,9 @@
class Super {
void foo1() {}
@Deprecated
void foo2() {}
}
class Sub extends Super {
foo<caret>
}
@@ -1410,6 +1410,13 @@ class XInternalError {}
checkResult()
}
public void testStrikeOutDeprecatedSuperMethods() {
configure()
myFixture.assertPreferredCompletionItems 0, 'void foo1', 'void foo2'
assert !LookupElementPresentation.renderElement(lookup.items[0]).strikeout
assert LookupElementPresentation.renderElement(lookup.items[1]).strikeout
}
public void testAccessorViaCompletion() {
configure()