Open litols opened 9 months ago
Hi,
which problems did you had with mixing the detekt and kotlin plugins?
Detekt uses the embeddable compiler and Intellij the unshaded compiler, which conflicts occur?
For example gradle runIde
runs the detekt plugin besides the Kotlin 1.6 plugin and it works fine on my side.
You think this change also fix showing Kotlin compiler errors as detekt plugin errors https://github.com/detekt/detekt-intellij-plugin/issues/271 ?
Unfortunately shading the compiler lib does not help with using the normal compiler classes: https://github.com/detekt/detekt-intellij-plugin/issues/271 2023-11-05 16:45:29,195 [ 25461] SEVERE - #c.i.o.u.ObjectTree - class org.jetbrains.kotlin.psi.KtNamedFunction cannot be cast to class detekt.shadow.org.jetbrains.kotlin.psi.KtModifierListOwner
sorry for too late response.
which problems did you had with mixing the detekt and kotlin plugins?
Detekt uses the embeddable compiler and Intellij the unshaded compiler, which conflicts occur? You think this change also fix showing Kotlin compiler errors as detekt plugin errors https://github.com/detekt/detekt-intellij-plugin/issues/271 ?
I think kotlin plugin picking up the kotlin compiler from detekt plugin wrongly. Reasons:
Thus,I think we can mitigate #271 with relocating the classes which uses in kotlin plugin.
JFYI, kotlin-intellij-plugin is relocating kotlin PSI files, https://github.com/nbadal/ktlint-intellij-plugin/tree/main/lib but the relocating is applied partially, it seems we need picking up correct classes. maybe KtNamedFunction need to excluding from relocating in detekt-intellij-plugin.
Anyway, I've applied your review comments to this pull request. thank you for your review!
Motivation:
detekt-intellij-plugin
.Modification:
detekt-intellij-plugin
.