detekt/detekt-intellij-plugin

All rules marked with @RequiresTypeResolution annotation cannot be recognized

ljcmeng opened this issue · 1 comments

Hello, I found that all rules marked with @RequiresTypeResolution cannot be recognized. Such as ForbiddenVoid
The reason is that no CompilerSpec configuration is provided when initializing ProcessingSpec.
There is a classpath configuration item that I don’t know how to fill in. Does anyone know if this is "by design" or "bug"?

The plugin was started before detekt supported type resolution.
One could say, it is "by design" to not slow down the analysis as every change triggers a whole detekt run like using it from the cli.
Idea and detekt both bundle different Kotlin compilers which do not work nice together at runtime.
Therefore, the Intellij plugin only uses detekt's api module and service loaders to start detekt.
Using the embedded Kotlin compiler classes directly will lead to classloader problems.

One could try to determine the classpath via some IntelliJ api and pass it to the spec.