mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
[java-intentions] Create type parameter is not available for record components
IDEA-291332 GitOrigin-RevId: 636d4212fe6eaea5d1269c85b83be710ee4b5869
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0e1dd4d61b
commit
2cd4777e8a
@@ -167,7 +167,7 @@ public class CreateTypeParameterFromUsageFix extends BaseIntentionAction {
|
||||
if (!PsiUtil.isLanguageLevel5OrHigher(element)) return null;
|
||||
if (element.isQualified()) return null;
|
||||
PsiElement container = PsiTreeUtil.getParentOfType(element, PsiReferenceList.class, PsiClass.class, PsiMethod.class, PsiClassInitializer.class, PsiStatement.class);
|
||||
if (container == null || container instanceof PsiClass) return null;
|
||||
if (container == null || (container instanceof PsiClass aClass && !aClass.isRecord())) return null;
|
||||
PsiElement parent = element.getParent();
|
||||
if (parent instanceof PsiMethodCallExpression ||
|
||||
parent instanceof PsiJavaCodeReferenceElement ||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Create type parameter 'T'" "true"
|
||||
|
||||
record Point<T>(T x, T y) {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Create type parameter 'T'" "true"
|
||||
|
||||
record Point(T<caret> x, T y) {
|
||||
}
|
||||
Reference in New Issue
Block a user