mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Parameter Name Hints] do not show hints for generic builders (IDEA-163214)
This commit is contained in:
@@ -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) {
|
||||
|
||||
+22
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user