-
Notifications
You must be signed in to change notification settings - Fork 25
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 plugin migration #321
base: master
Are you sure you want to change the base?
K2 plugin migration #321
Conversation
build.gradle.kts
Outdated
//tasks.named<RunIdeTask>("runIde") { | ||
// jvmArgumentProviders += CommandLineArgumentProvider { | ||
// listOf("-Didea.kotlin.plugin.use.k2=true") | ||
// } | ||
//} | ||
|
||
//tasks.test { | ||
// jvmArgumentProviders += CommandLineArgumentProvider { | ||
// listOf("-Didea.kotlin.plugin.use.k2=true") | ||
// } | ||
//} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should not commit out-commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without vm options, tests and debug IDE would be run against K1 mode. It's ok for 242 and below but for the 243+, it should be changed to something else. It's better to separate migration of the plugin and migration of the test infra indeed. Hopefully, it would be easy for the maintainers to find corresponding options without the comments.
@@ -21,51 +21,6 @@ class SpecTests : LightJavaCodeInsightFixtureTestCase() { | |||
return false | |||
} | |||
|
|||
fun testIsContainedInSpecFunSpec() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of merging `master´, rebase to keep the PR's history clean of merge commits for more convenient review.
- starting from 242, the plugin works over AnalysisAPI which hides all details about kotlin engine used inside kotlin plugin itself
@akozlova, could you please have a look at the test failures? There seems to be some Java version 17 vs 11 mismatch. |
Thanks for your work @akozlova! i just wanted to report that I built the plugin locally (I commented everything but IC-242, because that's what I'm using, and also added |
I am sorry, which warning? Unfortunately I see compilation errors due to 2.1.0 used to compile new 243 builds and I can't fix it locally for now :/ |
The warning was:
The given link mentions to add |
With the following changes I could build 242 and 243 locally: From 9cb825461f8848c0820c8341c07b1e179ecaa347 Mon Sep 17 00:00:00 2001
From: Paul Schyska <[email protected]>
Date: Thu, 17 Oct 2024 17:52:25 +0200
Subject: [PATCH] Bump kotlin to 2.0.21, don't ignore kotlinx-coroutines
dependencies
---
build.gradle.kts | 10 +++++-----
gradle.properties | 2 ++
gradle/libs.versions.toml | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/build.gradle.kts b/build.gradle.kts
index 19e28da..933ce47 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -172,11 +172,11 @@ dependencies {
}
configurations.all {
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-jdk8")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test-jvm")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-jdk8")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test-jvm")
}
sourceSets {
diff --git a/gradle.properties b/gradle.properties
index b571e4f..f9f6c6b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,3 +6,5 @@ version=1.1.0
org.gradle.caching=true
sandbox = /tmp/
+
+kotlin.stdlib.default.dependency = false
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 550808d..d395689 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,5 +1,5 @@
[versions]
-kotlin = "1.9.25"
+kotlin = "2.0.21"
runtime-kotest = "4.2.0"
# We separate these from the actual runtime dependencies
test-kotest = "5.9.1"
--
2.46.1
This updates kotlin to 2.0.21, and un-excludes kotlinx-coroutines dependencies. I don't know why they were excluded in the first place though, so this might wrong.
and it built. I don't have any intellij plugin experience, but maybe this helps you 😄 |
Exclusion was done to avoid conflicts on runtime during running tests. 243 bundles patched version of coroutines and then it leads to exceptions like
But the idea is actually good, many thanks! I think, just excluding on runtime should do the trick. |
@@ -1,5 +1,5 @@ | |||
[versions] | |||
kotlin = "1.9.25" | |||
kotlin = "2.0.21" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this impact users or does it not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's impossible to use 1.9.x version with kotlin jars from 243 platform anymore, because they were compiled with 2.1 already. Unfortunately, I think, I missed one version indeed: it seems, 223 was build with 1.8 and it won't be compatible with 2.0. Can we drop 223 or do I need to provide logic to make the version dependant on the platform version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop 223
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then there should be no problems with later versions
.flatMap { ref -> | ||
// SurroundSelectionWithFunctionIntention.isAvailable is called in EDT before the intention is applied | ||
// unfortunately API to avoid this was introduced in 23.2 only | ||
// this we need to move intentions to the facade or accept EDT here until 23.2- are still supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you clarify this comment, it doesn't quite make sense to me (about the intention)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the comment on allowing resolve on EDT which is prohibited, because it might be slow and lead to freezes of the whole IDE. It's possible to avoid this suppression if we would rewrite SurroundSelectionWithFunctionIntention
but the API doesn't exist for older versions and we would need to have it in facade. So I decided to wait until you drop older versions and currently do nothing about it.
They were excluded because otherwise there's a clash (or was, maybe excluding kotlin itself avoids that). |
Evident usages of K1 api (resolve) are migrated