detekt / detekt-intellij-plugin

detekt plugin for IntelliJ
https://plugins.jetbrains.com/plugin/10761-detekt
Apache License 2.0
290 stars 39 forks source link

org.jetbrains.kotlin.idea.KotlinFileType error #495

Open ljcmeng opened 9 months ago

ljcmeng commented 9 months ago

I am doing secondary development of detekt-intellij-plugin. When I use the two libraries detekt and android-lint, there are some kotlin-related class conflicts. The kotlin method in android lint cannot be loaded. Android lint can run normally only when kotlin-compiler-embeddable is excluded. But at this time, the kotlin method in detekt starts to be error. I guess this is because detektuses kotlin-compiler-embeddable instead of kotlin-compiler. But I don’t know how should it be solved.

Here is my dependency in build.gradle

dependencies {

    implementation("io.gitlab.arturbosch.detekt:detekt-api:1.23.1") {
//        exclude("org.jetbrains.kotlin", "kotlin-compiler-embeddable")
    }
    implementation("io.gitlab.arturbosch.detekt:detekt-tooling:1.23.1") {
//        exclude("org.jetbrains.kotlin", "kotlin-compiler-embeddable")

    }

    runtimeOnly("io.gitlab.arturbosch.detekt:detekt-core:1.23.1")
    runtimeOnly("io.gitlab.arturbosch.detekt:detekt-rules:1.23.1")
    runtimeOnly("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1")

    implementation("com.android.tools.lint:lint:30.2.0") {
        exclude("com.android.tools.external.com-intellij", "intellij-core")
        exclude("com.android.tools.external.com-intellij", "kotlin-compiler")
        exclude("com.android.tools.external.org-jetbrains", "uast")
    }

}
arturbosch commented 8 months ago

Could you try out if this branch fixes the plugin imcompatibiity? https://github.com/detekt/detekt-intellij-plugin/pull/496