Hi, guys. Im doing some experiments with k2 fronte...
# compiler
a
Hi, guys. Im doing some experiments with k2 frontend plugin and i have written checkrs that shows errors and warnings. But there is problem: errors and warnings are displayed after build in Build panel, but not in code editor as it was shown on KotlinConf. What i did: - added dependency via
kotlinCompilerPluginClasspath
- built K2 idea from sources - disabled kotlin.k2.only.bundled.compiler.plugins.enabled - added plugin jar via additional argument in idea settings. When I debug i see that idea finds my plugin, but it doesnt work. What am I missing? What should I do?
y
Basically, the IDE Kotlin plugin is not using FIR just yet, and so it's completely unaware of your added checkers. When Kotlin 2.0 releases, the plugin will get an update that makes it FIR compatible
j
An IDEA version with K2 is used so it is using FIR
Have you had some generation with FIR and does it work?
a
No, my plugin doesnt generate additional code and doesnt change current, but it checks - i have extended and written my
FirAdditionalCheckersExtension
and registered my
FirDeclarationChecker
as it is done in compose compiler. To show errors and warnings i use
DiagnosticReporter
that i get as an argument in
check
method in
FirDeclarationChecker
j
I haven’t tried checkers for a long time, generation was working a few weeks ago (not sure today from my side).
a
How do you build IDEA K2? I just click run for configuration and builded idea is so unstable. Maybe my fir plugin is not working because i have compiled incorrectly
a
Have you resolved the issue? I'm having the exact same problem. Warnings/errors show during compilation, but not in the IDE (using K2 Community with registry flag enabled).
a
Unfortunately, no. But you should disable
kotlin.k2.only.bundled.compiler.plugins.enabled
as suggested in other thread