mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java-inspections] IDEA-346242 Add 'minimal java version' clause automatically to inspection descriptions, based on the required feature(s)
GitOrigin-RevId: 50a25148d4d36c46e9552b3123d1ef966b40a2c2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a028674bdb
commit
64327f79d6
@@ -4,6 +4,7 @@ package com.intellij.pom.java;
|
||||
import com.intellij.core.JavaPsiBundle;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.util.lang.JavaVersion;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
@@ -167,6 +168,16 @@ public enum LanguageLevel {
|
||||
return myVersion.feature;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return short representation of the corresponding language level, like '8', or '21-preview'
|
||||
*/
|
||||
public @NlsSafe String getShortText() {
|
||||
if (this == JDK_X) {
|
||||
return "X";
|
||||
}
|
||||
return feature() + (isPreview() ? "-preview" : "");
|
||||
}
|
||||
|
||||
/** See {@link JavaVersion#parse(String)} for supported formats. */
|
||||
@Nullable
|
||||
public static LanguageLevel parse(@Nullable String compilerComplianceOption) {
|
||||
|
||||
Reference in New Issue
Block a user