mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 01:09:46 +07:00
This patch fixes the problems according to the code review, it includes: - moving extractHighlightingFeature to HighlightingFeature and renaming it to fromPreviewFeatureAnnotation - assuring the PreviewFeature annotation name by calling PsiAnnotation#hasQualifiedName instead of comparing the name by equals - moving JDK_INTERNAL_PREVIEW_FEATURE to HighlightingFeature - extracting repeating part of checking the language level to HighlightUtil#checkPreviewFeatureElement - adding a new case "SEALED_CLASSES" to HighlightFeature#fromPreviewAnnotationName In addition to that there is also more robust solution to detect invalid contexts in references and static imports. The test data updated accordingly. Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: 999d43ec5d9315d0881d08ce9341433707de96a0
28 lines
531 B
Java
28 lines
531 B
Java
package jdk.internal;
|
|
|
|
import java.lang.annotation.*;
|
|
|
|
@Target({ElementType.METHOD,
|
|
ElementType.CONSTRUCTOR,
|
|
ElementType.FIELD,
|
|
ElementType.PACKAGE,
|
|
ElementType.TYPE})
|
|
@Retention(RetentionPolicy.CLASS)
|
|
public @interface PreviewFeature {
|
|
/**
|
|
* Name of the preview feature the annotated API is associated
|
|
* with.
|
|
*/
|
|
public Feature feature();
|
|
|
|
public boolean essentialAPI() default false;
|
|
|
|
public enum Feature {
|
|
PATTERN_MATCHING_IN_INSTANCEOF,
|
|
TEXT_BLOCKS,
|
|
RECORDS,
|
|
SEALED_CLASSES
|
|
;
|
|
}
|
|
}
|