[Parameter Name Hints] do not show hints for generic builders (IDEA-163214)

This commit is contained in:
Yaroslav Lepenkin
2016-10-27 16:08:30 +03:00
parent 0636ef12c7
commit 027df2e7c9
2 changed files with 23 additions and 1 deletions
@@ -60,7 +60,7 @@ public class JavaParameterHintManager {
if (expression instanceof PsiNewExpression) {
return false;
}
final PsiType returnType = method.getReturnType();
PsiType returnType = TypeConversionUtil.erasure(method.getReturnType());
final PsiClass aClass = method.getContainingClass();
final String calledMethodFqn = aClass != null ? aClass.getQualifiedName() : null;
if (calledMethodFqn != null && returnType != null) {
@@ -92,6 +92,28 @@ class Fooo {
onLineStartingWith("assertEquals").assertInlays("expected->\"fooo\"")
onLineStartingWith("show").assertInlays("message->\"Hi\"")
}
fun `test no hints for generic builders`() {
setup("""
class Foo {
void test() {
new IntStream().skip(10);
new Stream<Integer>().skip(10);
}
}
class IntStream {
public IntStream skip(int n) {}
}
class Stream<T> {
public Stream<T> skip(int n) {}
}
""")
onLineStartingWith("new IntStream").assertNoInlays()
onLineStartingWith("new Stream").assertNoInlays()
}
fun `test do not show hints on setters`() {
setup("""class Groo {