mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UnstableApiUsageInspection: do not run the inspection if no unstable annotation is found in the project.
GitOrigin-RevId: 78b4bfe94f550a5bf92211f90e3e18eb19b1b2b5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c9a3e498a
commit
eb9f0e682d
+16
-8
@@ -51,15 +51,23 @@ class UnstableApiUsageInspection : LocalInspectionTool() {
|
||||
@JvmField
|
||||
var myIgnoreInsideImports: Boolean = true
|
||||
|
||||
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor =
|
||||
ApiUsageUastVisitor.createPsiElementVisitor(
|
||||
UnstableApiUsageProcessor(
|
||||
holder,
|
||||
myIgnoreInsideImports,
|
||||
unstableApiAnnotations.toList(),
|
||||
knownAnnotationMessageProviders
|
||||
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
|
||||
val annotations = unstableApiAnnotations.toList()
|
||||
val psiFacade = JavaPsiFacade.getInstance(holder.project)
|
||||
val resolveScope = holder.file.resolveScope
|
||||
return if (annotations.any { psiFacade.findClass(it, resolveScope) != null }) {
|
||||
ApiUsageUastVisitor.createPsiElementVisitor(
|
||||
UnstableApiUsageProcessor(
|
||||
holder,
|
||||
myIgnoreInsideImports,
|
||||
annotations,
|
||||
knownAnnotationMessageProviders
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
PsiElementVisitor.EMPTY_VISITOR
|
||||
}
|
||||
}
|
||||
|
||||
override fun createOptionsPanel(): JPanel {
|
||||
val checkboxPanel = SingleCheckboxOptionsPanel(
|
||||
|
||||
Reference in New Issue
Block a user