mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-06 09:36:56 +07:00
This patch adds the PreviewFeatureInspection inspection that is enabled only when the language level of the project is a preview one. It allows to register warnings and suppress all the preview warnings as it's done in javac. When the language level of the project is not a preview one, HighlightVisitorImpl runs the same visitor that can report errors instead of warnings. It cannot be suppressed. A PSI element is considered a preview feature when either: - it is annotated with PreviewFeature directly - one of its enclosing classes is annotated with PreviewFeature - its module is annotated with PreviewFeature It's worth mentioning that when a package in package-info.java is annotated with PreviewFeature this flag doesn't get to be propagated to the classes that are inside the package. Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com> GitOrigin-RevId: 5bd22ea2e18ba83303156a2b9665bc54622f6344
12 lines
1.2 KiB
Java
12 lines
1.2 KiB
Java
|
|
import <error descr="com.mycom.FirstPreviewFeature is a preview API and may be removed in a future release">com.mycom.FirstPreviewFeature</error>;
|
|
import <warning descr="com.mycom.FirstPreviewFeatureReflective is a preview API and may be removed in a future release">com.mycom.FirstPreviewFeatureReflective</warning>;
|
|
|
|
class Main {
|
|
{
|
|
<error descr="com.mycom.FirstPreviewFeature is a preview API and may be removed in a future release">FirstPreviewFeature</error>.g();
|
|
Runnable r1 = <error descr="com.mycom.FirstPreviewFeature is a preview API and may be removed in a future release">FirstPreviewFeature</error>::g;
|
|
<warning descr="com.mycom.FirstPreviewFeatureReflective#g is a preview API and may be removed in a future release"><warning descr="com.mycom.FirstPreviewFeatureReflective is a preview API and may be removed in a future release">FirstPreviewFeatureReflective</warning>.g</warning>();
|
|
Runnable r2 = <warning descr="com.mycom.FirstPreviewFeatureReflective#g is a preview API and may be removed in a future release"><warning descr="com.mycom.FirstPreviewFeatureReflective is a preview API and may be removed in a future release">FirstPreviewFeatureReflective</warning>::g</warning>;
|
|
}
|
|
} |