Hi all, I'm creating a compiler plugin and for som...
# compiler
b
Hi all, I'm creating a compiler plugin and for some scenarios I want to report some warning / error diagnostics, with them I would like to make the IntelliJ IDE visually underline certain expression with the warning / error inspections (the yellow and red line). I'm being able to report diagnostics correctly using a FIR extension but no success with the IntelliJ IDE visual inspection part, this warning / error inspection is supported by Kotlin compiler plugins (if so, could you provide me an example?) or should I create an IntelliJ IDEA plugin to make this IDE part?
y
I believe this should work as long as you turn on K2 mode in IDEA
b
@Youssef Shoaib [MOD] Do you have an example of a compiler plugin doing that? Even enabling K2 mode in the IDEA not appearing the inspections. Maybe I'm doing something wrong in the code
Have you enabled K2 and third party plugins on the IDE? Check the instructions on the readme of Kopy
b
@raulraja @Javier Thank you for the help, I hadn't tried to disable
kotlin.k2.only.bundled.compiler.plugins.enabled
By doing that now I'm seeing this IDE internal error
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/com/intellij/psi/PsiElement
Did you face this problem when working on Kopy?
j
No, it is weird, looks like a basic dependency. Are you using the template for compiler plugins?
b
Fixed that issue, that was happening because I was trying to report the diagnostic on top of something that wasn't a PsiElement. It's working now but for some reason the IDEA takes a long time to update the error / warning inspections in the code