kotest-intellij-plugin icon indicating copy to clipboard operation
kotest-intellij-plugin copied to clipboard

K2 compiler compatibility

Open zakhenry opened this issue 1 year ago • 20 comments

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

Screenshot 2024-03-26 at 7 53 15 PM

zakhenry avatar Mar 26 '24 06:03 zakhenry

https://slack-chats.kotlinlang.org/t/16947255/what-is-required-of-plugin-authors-to-support-k2-mode-for-in#cdbf8020-797e-4e62-a1cc-660f8aa0d168

bukajsytlos avatar Apr 26 '24 08:04 bukajsytlos

We would also like to switch to K2. Is there a goal to make the plugin compatible in the near future?

mrclrchtr avatar Jun 19 '24 13:06 mrclrchtr

For the v6 release of kotest, kotlin 2.0 (and therefore k2) will be the default.

sksamuel avatar Jun 24 '24 01:06 sksamuel

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

Kantis avatar Jun 27 '24 12:06 Kantis

Hey there, @Kantis is there any update/ETA on when the plugin issue will be fixed?

zetbrush avatar Aug 02 '24 03:08 zetbrush

IntelliJ 2024.2 landed today, with K2 mode in Beta. Lack of kotest plugin support is a blocker for enabling K2 in the IDE.

cloudshiftchris avatar Aug 07 '24 14:08 cloudshiftchris

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" :)

sksamuel avatar Aug 12 '24 01:08 sksamuel

Understood, thanks for the update. Sounds frustrating.

cloudshiftchris avatar Aug 12 '24 01:08 cloudshiftchris

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

OliverO2 avatar Aug 12 '24 15:08 OliverO2

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

cloudshiftchris avatar Aug 12 '24 15:08 cloudshiftchris

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 avatar Aug 12 '24 16:08 cloudshiftchris

@cloudshiftchris where did you find that info? I would like to check any following discussion etc.

Kantis avatar Aug 15 '24 19:08 Kantis

@Kantis It came from Slack discussion: https://kotlinlang.slack.com/archives/C0B8H786P/p1723426657187059

cloudshiftchris avatar Aug 15 '24 19:08 cloudshiftchris

IntelliJ 2024.2.1 came out yesterday, so there's hope this plugin can be properly updated now.

mamuf avatar Aug 30 '24 09:08 mamuf

Any news on this?

pschyska avatar Sep 16 '24 11:09 pschyska

For reference, maybe it helps to see what the JTE plugin did in this regard.

sschuberth avatar Sep 16 '24 12:09 sschuberth

So when the Kotest 6.0 is going to be released along with the new plugin?

rzukowski-equinix avatar Sep 17 '24 11:09 rzukowski-equinix

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

sschuberth avatar Sep 22 '24 05:09 sschuberth

Migration PR: https://github.com/kotest/kotest-intellij-plugin/pull/321

akozlova avatar Oct 07 '24 14:10 akozlova

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):

  1. IJ Ultimate 2024.2.4 (kt 2.0.21 & kt 2.1.0 beta) - kotest plugin built with java 17
  2. 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.

jtonic avatar Oct 25 '24 07:10 jtonic

Hello @sksamuel! So what is the status of this? Intellij 2024.3 releases with stable K2 mode.

rzukowski-equinix avatar Nov 14 '24 08:11 rzukowski-equinix

Kotest plugin 1.3.86-243-EAP-SNAPSHOT was released already, which supports Intellij 2024.3 in K2 mode.

sschuberth avatar Nov 14 '24 08:11 sschuberth

@sschuberth thanks you're right! Either IntellJ didn't prompt me for update or I've missed it.

rzukowski-equinix avatar Nov 14 '24 09:11 rzukowski-equinix