Skip to content

[JetBrains] Make backend-plugin compatible with 2025.2 #20871

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

Merged
merged 7 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ plugins {
// Java support
id("java")
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
id("org.jetbrains.kotlin.jvm") version "2.0.0"
id("org.jetbrains.kotlin.jvm") version "2.2.0-RC"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij.platform") version "2.0.0-beta8"
id("org.jetbrains.intellij.platform") version "2.6.0"
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.23.6"
Expand Down Expand Up @@ -158,7 +158,9 @@ tasks {
targetCompatibility = "21"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "21"
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
}
}

buildSearchableOptions {
Expand All @@ -175,8 +177,8 @@ tasks {

tasks.register("runPluginVerifier") {
if (properties("platformType") == "RD") {
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
} else {
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
}
}
12 changes: 7 additions & 5 deletions components/ide/jetbrains/backend-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ plugins {
// Java support
id("java")
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
id("org.jetbrains.kotlin.jvm") version "2.0.0"
id("org.jetbrains.kotlin.jvm") version "2.2.0-RC"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij.platform") version "2.0.0-beta8"
id("org.jetbrains.intellij.platform") version "2.6.0"
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.23.6"
Expand Down Expand Up @@ -158,7 +158,9 @@ tasks {
targetCompatibility = "21"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "21"
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
}
}

buildSearchableOptions {
Expand All @@ -175,8 +177,8 @@ tasks {

tasks.register("runPluginVerifier") {
if (properties("platformType") == "RD") {
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
} else {
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
# revert pluginSinceBuild if it's unnecessary
pluginSinceBuild=251.17181
pluginUntilBuild=251.*
pluginSinceBuild=252.18003
pluginUntilBuild=252.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions.
pluginVerifierIdeVersions=2025.1
pluginVerifierIdeVersions=2025.2
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/updates/updates.xml or exec `./gradlew printProductsReleases`
platformVersion=251.17181.16
platformVersion=252.18003.27
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pluginUntilBuild=251.*
# See https://jb.gg/intellij-platform-builds-list for available build versions.
pluginVerifierIdeVersions=2025.1
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/intellij-repository/snapshots
platformVersion=251.25410-EAP-CANDIDATE-SNAPSHOT
platformVersion=251.26094.98
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
package kotlinx.coroutines.guava

import com.google.common.util.concurrent.*
import com.google.common.util.concurrent.internal.InternalFutureFailureAccess
import com.google.common.util.concurrent.internal.InternalFutures
import com.google.common.util.concurrent.internal.*
import kotlinx.coroutines.*
import java.util.concurrent.*
import java.util.concurrent.CancellationException
Expand Down Expand Up @@ -138,10 +137,10 @@ public fun <T> ListenableFuture<T>.asDeferred(): Deferred<T> {
// Finally, if this isn't done yet, attach a Listener that will complete the Deferred.
val deferred = CompletableDeferred<T>()
Futures.addCallback(this, object : FutureCallback<T> {
override fun onSuccess(result: T?) {
override fun onSuccess(result: T) {
// Here we work with flexible types, so we unchecked cast to trick the type system
@Suppress("UNCHECKED_CAST")
runCatching { deferred.complete(result as T) }
runCatching { deferred.complete(result) }
.onFailure { handleCoroutineException(EmptyCoroutineContext, it) }
}

Expand Down Expand Up @@ -225,7 +224,7 @@ public fun <T> Deferred<T>.asListenableFuture(): ListenableFuture<T> {
*
* This suspend function is cancellable.
*
* If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function
* If the [Job] of the current coroutine is cancelled while this suspending function is waiting, this function
* stops waiting for the future and immediately resumes with [CancellationException][kotlinx.coroutines.CancellationException].
*
* This method is intended to be used with one-shot Futures, so on coroutine cancellation, the Future is cancelled as well.
Expand All @@ -247,8 +246,7 @@ public suspend fun <T> ListenableFuture<T>.await(): T {
return suspendCancellableCoroutine { cont: CancellableContinuation<T> ->
addListener(
ToContinuation(this, cont),
MoreExecutors.directExecutor()
)
MoreExecutors.directExecutor())
cont.invokeOnCancellation {
cancel(false)
}
Expand All @@ -265,7 +263,7 @@ public suspend fun <T> ListenableFuture<T>.await(): T {
private class ToContinuation<T>(
val futureToObserve: ListenableFuture<T>,
val continuation: CancellableContinuation<T>
) : Runnable {
): Runnable {
override fun run() {
if (futureToObserve.isCancelled) {
continuation.cancel()
Expand Down Expand Up @@ -346,7 +344,7 @@ private class ListenableFutureCoroutine<T>(
* could probably be compressed into one subclass of [AbstractFuture] to save an allocation, at the
* cost of the implementation's readability.
*/
private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableFuture<T> {
private class JobListenableFuture<T>(private val jobToCancel: Job): ListenableFuture<T> {
/**
* Serves as a state machine for [Future] cancellation.
*
Expand All @@ -356,7 +354,7 @@ private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableF
*
* To preserve Coroutine's [CancellationException], this future points to either `T` or [Cancelled].
*/
private val auxFuture = SettableFuture.create<Any>()
private val auxFuture = SettableFuture.create<Any?>()

/**
* `true` if [auxFuture.get][ListenableFuture.get] throws [ExecutionException].
Expand Down Expand Up @@ -441,7 +439,7 @@ private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableF
}

/** See [get()]. */
private fun getInternal(result: Any): T = if (result is Cancelled) {
private fun getInternal(result: Any?): T = if (result is Cancelled) {
throw CancellationException().initCause(result.exception)
} else {
// We know that `auxFuture` can contain either `T` or `Cancelled`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

package io.gitpod.jetbrains.remote.util

import com.intellij.testFramework.fixtures.BasePlatformTestCase
import io.gitpod.jetbrains.remote.utils.LocalHostUri
import io.gitpod.jetbrains.remote.utils.LocalHostUri.LocalHostUriMetadata
import java.net.URI
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

class LocalHostUriTest : BasePlatformTestCase() {
internal class LocalHostUriTest {
@Test
fun testExtractLocalHostUriMetaDataForPortMapping() {
val urlToMetadataMap = mapOf(
"https://localhost:80" to object: LocalHostUriMetadata {
Expand Down
Loading