Hi guys! I am in the process of creation of my own...
# compiler
a
Hi guys! I am in the process of creation of my own compiler plugin, hope it's the right place to ask My current issue is that I am trying to make all FIR generation, as well as FIR diagnostics run without the need to build, or compile my project I've seen similar behavior while working with the kopy plugin, but I am not able to replicate this behavior, nor was I able to contact the author, unfortunately Things that I have tried already: • explicitelly using FIR option, on pre-K2 compilers • migrating to K2 and enabling it in my IDE, plus unchecking only.bundled.plugins option • mentioning my plugin in -XPlugin argument But as I said, it all leads to my plugin actually generating code after project's compilation start May be somebody can help me highlight what am I doing wrong?
y
You might need to enable K2 mode in the Kotlin Idea plugin
h
With IntelliJ 2025.1, K2 mode is enabled by default but you need to enable third party compiler plugins manually to see the effect of the plugin: https://kotlinlang.slack.com/archives/C0B8H786P/p1744808206685879
a
Yes, I forgot to mention that K2 is enable in my IDE, and only.bundled.plugins is unmarked
j
Hey 👋 I am the author, where did you try to contact me? 🤔
👋 1
a
Ohhh, gosh😅 It's nice to meet you!!! I was trying to connect to you on Linkedin a couple of times, and via your site, but it seems to be not able to deliver messages
j
Didn’t remember my site can send emails/messages, I haven’t used it for years hahah, sorry!
😂 1
I haven’t tried my plugin by passing the argument manually but just using the Gradle plugin, are you sure your plugin is being picked? Do you see some logs or something?
A simple way to check if it is being picked without needing to debug is just by executing some
error(“whatever”)
in a FIR extension and checking if the IDE opens an error popup
🤔 1
h
Yeah, using error (with dump) is also my best debug experience 🫠
j
it is the same on Gradle, every time I enable debug, the scripts that uses accessors on Gradle test kit tests fail so I end up launching the test multiple times with
error
👀 1
a
Yes, currently there is only FIR diagnostics connected, and it works good, if I assemble my project, and compilation process starts off But otherwise, it seems to be either IDLE, or absent Previous to FIR, I tried IR generation with dumping generated code into log console, and it also worked okay only after compilation process was started off
Btw, I guess by saying that plugin wasn't passed via arguments manually -XPlugin argument was referred; I saw it being used after looking into this source code being applied here So, I thought that kotlin compiler needs explicit jar to fully integrate it😆
I guess, I will look into test cases, and try to navigate from there