Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K2 compiler compatibility #289

Closed
zakhenry opened this issue Mar 26, 2024 · 22 comments
Closed

K2 compiler compatibility #289

zakhenry opened this issue Mar 26, 2024 · 22 comments

Comments

@zakhenry
Copy link

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 zakhenry changed the title Add compatibility with K2 compiler K2 compiler compatibility Mar 26, 2024
@bukajsytlos
Copy link

@mrclrchtr
Copy link

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

@sksamuel
Copy link
Member

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

@Kantis
Copy link
Member

Kantis commented Jun 27, 2024

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

@zetbrush
Copy link

zetbrush commented Aug 2, 2024

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

@cloudshiftchris
Copy link

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

@sksamuel
Copy link
Member

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

@cloudshiftchris
Copy link

Understood, thanks for the update. Sounds frustrating.

@OliverO2
Copy link

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

@cloudshiftchris
Copy link

cloudshiftchris commented Aug 12, 2024

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
Copy link

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.

@Kantis
Copy link
Member

Kantis commented Aug 15, 2024

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

@cloudshiftchris
Copy link

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

@mamuf
Copy link

mamuf commented Aug 30, 2024

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

@pschyska

This comment was marked as outdated.

@sschuberth
Copy link
Member

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

@rzukowski-equinix

This comment was marked as abuse.

@sschuberth
Copy link
Member

@akozlova
Copy link
Contributor

akozlova commented Oct 7, 2024

Migration PR: #321

@jtonic
Copy link

jtonic commented Oct 25, 2024

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.

@rzukowski-equinix
Copy link

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

@sschuberth
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests