mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] BAZEL-2389: KotlinGoodCodeRedVisitor shouldn't analyze files with OFF highlighting
GitOrigin-RevId: 011c6acd2c49b9391196b4aaae9611a5cb602ba6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c26981246f
commit
39f628ceca
@@ -22,6 +22,7 @@ jvm_library(
|
||||
"//platform/platform-api:ide",
|
||||
"//platform/util:util-ui",
|
||||
"//java/java-psi-api:psi",
|
||||
"//plugins/kotlin/highlighting/highlighting-shared:kotlin-highlighting-shared",
|
||||
"@lib//:kotlinc-analysis-api-provided",
|
||||
"@lib//:kotlinc-kotlin-compiler-common-provided",
|
||||
],
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.ide" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.ui" />
|
||||
<orderEntry type="module" module-name="intellij.java.psi" />
|
||||
<orderEntry type="module" module-name="kotlin.highlighting.shared" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="kotlinc.analysis-api" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="kotlinc.kotlin-compiler-common" level="project" />
|
||||
</component>
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.analysis.api.analyze
|
||||
import org.jetbrains.kotlin.analysis.api.components.KaDiagnosticCheckerFilter
|
||||
import org.jetbrains.kotlin.analysis.api.diagnostics.KaSeverity
|
||||
import org.jetbrains.kotlin.idea.base.highlighting.shouldHighlightFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtVisitor
|
||||
|
||||
@@ -21,6 +22,7 @@ internal class KotlinGoodCodeRedVisitor : GoodCodeRedVisitor {
|
||||
super.visitFile(file)
|
||||
try {
|
||||
analyze(file as KtFile) {
|
||||
if (!file.shouldHighlightFile()) return
|
||||
val diagnostics = file.collectDiagnostics(KaDiagnosticCheckerFilter.ONLY_COMMON_CHECKERS)
|
||||
for (diagnostic in diagnostics) {
|
||||
if (diagnostic.severity == KaSeverity.ERROR) {
|
||||
|
||||
Reference in New Issue
Block a user