Platform logo

JetBrains Platform

Plugin and extension development for JetBrains products.

IntelliJ IDEA Kotlin Marketplace

Migrating Your IntelliJ IDEA Kotlin Plugin to K2 Mode

We recently shared the news about the Kotlin K2 mode, a new implementation of Kotlin support in IntelliJ IDEA designed to improve IDE stability and support future Kotlin language features. We plan to enable K2 mode by default in the nearest IntelliJ IDEA releases, so it’s essential to start migrating your plugins now so they will be compatible.

If your plugin uses the K1 API, like the following:

Descriptors (classes from the org.jetbrains.kotlin.descriptors.* package, such as ClassDescriptor or FunctionDescriptor)

BindingContext (from org.jetbrains.kotlin.resolve.*)

ResolutionFacade (from org.jetbrains.kotlin.idea.resolve.*)

You need to update your code so it would be compatible with the K2 mode. Please refer to the detailed migration guide.

Once updated, declare your plugin as compatible with K2 mode.
Your plugin will still be compatible with K1 mode.

Plugins that haven’t been dependent on the previous API may automatically work in K2 mode. We recommend that you verify that everything is working correctly.

Start your migration today to ensure a smooth transition when K2 mode becomes the default.
For questions or to share your experience, join this public Slack channel or submit feedback via YouTrack, or add a comment in the comments section below.

Happy Development!

image description