kotest-intellij-plugin
kotest-intellij-plugin copied to clipboard
K2 compiler compatibility
Announced today - https://blog.jetbrains.com/idea/2024/03/k2-kotlin-mode-alpha-in-intellij-idea/ the K2 compiler is available in Intellij 2024.1 RC, but kotest plugin fails to install:
Plugin is incompatible with the Kotlin plugin in K2 mode
https://slack-chats.kotlinlang.org/t/16947255/what-is-required-of-plugin-authors-to-support-k2-mode-for-in#cdbf8020-797e-4e62-a1cc-660f8aa0d168
We would also like to switch to K2. Is there a goal to make the plugin compatible in the near future?
For the v6 release of kotest, kotlin 2.0 (and therefore k2) will be the default.
Note that you can still use K2 for your project. You just can't use it for the IDE at the moment.
We're still waiting for information from JetBrains on how to enable our plugin with K2 IDE mode
Hey there, @Kantis is there any update/ETA on when the plugin issue will be fixed?
IntelliJ 2024.2 landed today, with K2 mode in Beta. Lack of kotest plugin support is a blocker for enabling K2 in the IDE.
It's in progress. I am waiting on a reply from Jetbrains what exactly needs to be done, as currently there are no docs in place on how to upgrade plugins that don't work. It just says "isn't compatible" :)
Understood, thanks for the update. Sounds frustrating.
I have never looked into IJ plugins, but do we have something like with K2 compiler plugins (in derivatives of CompilerPluginRegistrar)?
override val supportsK2 = true
From what I've been able to discern any plugin that has a dependency on the IJ Kotlin plugin is automatically marked as incompatible, except those on a magic "safe list". atm no evident way to make/mark your plugin as compatible (this is what JB needs to provide - docs/guides on how to make it compatible, and a mechanism to allow compatible plugins that isn't a hard-coded safe list).
reference: https://intellij-support.jetbrains.com/hc/en-us/community/posts/20630080086034
Feedback from JB:
Hey! We’ve published a guide on migration from K1 to K2: https://kotlin.github.io/analysis-api/migrating-from-k1.html The guide has a section on declaring that a plugin supports K2: https://kotlin.github.io/analysis-api/migrating-from-k1.html#declaring-compatibility-with-the-k2-kotlin-mode The setting will only be available starting from IntelliJ 2024.2.1 (Preview), which hasn’t been released yet AFAIK, but will be soon. By the way, the website I linked is a general guide for the Analysis API, which is the new analysis engine for K2 (and also has a K1 mode for backwards compatibility). Beyond the K1 to K2 migration guide, there’s a lot of information in the other sections of the guide which should help with migrating a plugin to the Analysis API.
@cloudshiftchris where did you find that info? I would like to check any following discussion etc.
@Kantis It came from Slack discussion: https://kotlinlang.slack.com/archives/C0B8H786P/p1723426657187059
IntelliJ 2024.2.1 came out yesterday, so there's hope this plugin can be properly updated now.
Any news on this?
For reference, maybe it helps to see what the JTE plugin did in this regard.
So when the Kotest 6.0 is going to be released along with the new plugin?
More references about what the Kobweb plugin did:
- https://github.com/varabyte/kobweb-intellij-plugin/pull/55/files
- https://github.com/varabyte/kobweb-intellij-plugin/pull/56/files
Migration PR: https://github.com/kotest/kotest-intellij-plugin/pull/321
Thanks for the PR, @akozlova
I've tested the PR on my local machine in two scenarios on the same project (Java 17, mvn 3.9.6, spring boot 3.2.5, kotest 5.9.1, arrow 1.2.4, coroutines 1.9.0):
- IJ Ultimate 2024.2.4 (kt 2.0.21 & kt 2.1.0 beta) - kotest plugin built with java 17
- IJ Ultimate 2024.3 EAP (kt 2.0.21 & kt 2.1.0 beta) - kotest plugin built with java 21
and found no evident or show-stopper issues.
Hello @sksamuel! So what is the status of this? Intellij 2024.3 releases with stable K2 mode.
Kotest plugin 1.3.86-243-EAP-SNAPSHOT was released already, which supports Intellij 2024.3 in K2 mode.
@sschuberth thanks you're right! Either IntellJ didn't prompt me for update or I've missed it.