How to comfortable with K2 compile
Answered
After enable K2 Kotlin Mode, it said that my plugin is not compatible.
I am not sure how to comfortable with k2.
In my plugin, I had use some build-in kotlin API for example
Please sign in to leave a comment.
Hi!
Unfortunately, at the moment, there is no explicit API to mark the particular IDE plugin as compatible with K2 Mode. If your plugin depends on Kotlin Plugin and is not in the “Safe plugins” list, it is automatically disabled to avoid potential compatibility issues.
Our team is in the process of preparing a migration mechanism for third-party plugin authors, but it is a work in progress. We will make additional announcements regarding this matter when we have those mechanisms in place.
Meanwhile, you can see the following guide about the K1/K2 compiler API differences:
https://kotlin.github.io/analysis-api/migrating-from-k1.html
This might help you understand how much you would need to change the code of your plugin to make it compatible with K2 Mode.
We also plan to extend our “Safe plugins” list by analyzing the publicly available IDE plugins and their API usage.
So if your plugin does not use a lot of APIs from Kotlin Plugin, there is a good chance that it might just start working out of the box at some point.
How to edit“Safe plugins” list manually?
Please see IDEA 2024.2.1 RC version, it seems k2 has just start working out of the box.
My plugin has comfortable.
Zarmour hi!
Currently, there is no way to influence the “Safe plugins” list from the outside.
However, as king s said above, you can go on and see if your plugin is already included there 🙏