[java] define "type parameters" element kind

GitOrigin-RevId: 883cd7f25b3ca5a3eac311b3c9b8b90fc3334653
This commit is contained in:
Bas Leijdekkers
2024-04-03 13:49:45 +02:00
committed by intellij-monorepo-bot
parent 9e22b48c16
commit f96bb8f6d4
5 changed files with 8 additions and 3 deletions

View File

@@ -2274,7 +2274,7 @@ public final class HighlightMethodUtil {
if (typeParameterList != null && typeParameterList.getTypeParameters().length > 0) {
HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeParameterList)
.descriptionAndTooltip(JavaErrorBundle.message("record.special.method.type.parameters", methodTitle));
IntentionAction action = QuickFixFactory.getInstance().createDeleteFix(typeParameterList.getTypeParameters());
IntentionAction action = QuickFixFactory.getInstance().createDeleteFix(typeParameterList);
info.registerFix(action, null, null, null, null);
return info;
}

View File

@@ -23,6 +23,7 @@ element.annotation=annotation
element.anonymous_class=anonymous class
element.class=class
element.type.parameter=type parameter
element.type.parameters=type parameters
element.constant=constant field
element.constructor=constructor
element.enum=enum

View File

@@ -45,6 +45,7 @@ public enum JavaElementKind {
THROWS_LIST("element.throws.list"),
TYPE_ARGUMENTS("element.type.arguments"),
TYPE_PARAMETER("element.type.parameter"),
TYPE_PARAMETERS("element.type.parameters"),
UNKNOWN("element.unknown"),
VARIABLE("element.variable");
@@ -137,6 +138,9 @@ public enum JavaElementKind {
}
return FIELD;
}
if (element instanceof PsiTypeParameterList) {
return TYPE_PARAMETERS;
}
if (element instanceof PsiReferenceParameterList) {
return TYPE_ARGUMENTS;
}

View File

@@ -1,4 +1,4 @@
// "Remove element" "true-preview"
// "Remove type parameters" "true-preview"
record R() {
R() {}
}

View File

@@ -1,4 +1,4 @@
// "Remove element" "true-preview"
// "Remove type parameters" "true-preview"
record R() {
<T, <caret>U> R() {}
}