From IntelliJ IDEA version 2025.1, K2 mode is the default. If you need to test the plugin in K1 mode locally, pass the -Didea.kotlin.plugin.use.k1=true VM option to the IntelliJ IDEA run configuration or to the test task.
If you use IntelliJ IDEA version 2024.3 or older, use -Didea.kotlin.plugin.use.k2=true to enable K2 mode.
When using the IntelliJ Platform Gradle Plugin, you can specify the option directly in the build.gradle.kts
file.
To run in a debug IntelliJ IDEA instance, submit the option to the RunIdeTask:
tasks.named<RunIdeTask>(“runIde”) {
jvmArgumentProviders += CommandLineArgumentProvider {
listOf(“-Didea.kotlin.plugin.use.k1=true”)
}
}To run tests against the Kotlin IntelliJ IDEA plugin in the K1 mode, add the option to the test task:
tasks.test {
jvmArgumentProviders += CommandLineArgumentProvider {
listOf(“-Didea.kotlin.plugin.use.k1=true”)
}
}