mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
diamond completion: allow class type parameters in constructor params list (IDEA-109942)
This commit is contained in:
@@ -287,7 +287,7 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
|
||||
}
|
||||
|
||||
public static boolean haveConstructorsGenericsParameters(@NotNull final PsiClass psiClass) {
|
||||
for (PsiMethod method : psiClass.getConstructors()) {
|
||||
for (final PsiMethod method : psiClass.getConstructors()) {
|
||||
for (PsiParameter parameter : method.getParameterList().getParameters()) {
|
||||
final PsiType type = parameter.getType();
|
||||
final Boolean accept = type.accept(new PsiTypeVisitor<Boolean>() {
|
||||
@@ -304,7 +304,8 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
|
||||
if (typaParamFound != null && typaParamFound) return true;
|
||||
}
|
||||
}
|
||||
return PsiUtil.resolveClassInType(classType) instanceof PsiTypeParameter;
|
||||
final PsiClass aClass = PsiUtil.resolveClassInType(classType);
|
||||
return aClass instanceof PsiTypeParameter && ((PsiTypeParameter)aClass).getOwner() == method;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class MyClass {
|
||||
public void foo() {
|
||||
MyDD<String> d = new MyDD<String>(<caret>);
|
||||
MyDD<String> d = new MyDD<>(<caret>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user