fwcd / kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
MIT License
1.62k stars 203 forks source link

chore: Bump Gradle to 8.3 and Kotlin to 1.9.10 #493

Closed chenrui333 closed 11 months ago

chenrui333 commented 12 months ago

fixes #492 relates to https://github.com/Homebrew/homebrew-core/pull/142023

chenrui333 commented 12 months ago

relates to #492 (it builds fine with gradle 8.1)

fwcd commented 11 months ago

The language server builds with Kotlin 1.9.10, but for some reason JDK standard library classes cannot be resolved, which is why some of the tests currently fail:

image

Updating to Gradle 8.3 without upgrading Kotlin on the other hand results in

> Task :server:compileKotlin FAILED
e: file:///Users/<user>/git/kotlin-language-server/server/src/main/kotlin/org/javacs/kt/Configuration.kt:53:28 Unresolved reference: fromJson
e: file:///Users/<user>/git/kotlin-language-server/server/src/main/kotlin/org/javacs/kt/Configuration.kt:69:5 'deserialize' overrides nothing
e: file:///Users/<user>/git/kotlin-language-server/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt:40:36 Unresolved reference: fromJson
e: file:///Users/<user>/git/kotlin-language-server/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt:41:34 Unresolved reference: fromJson
e: file:///Users/<user>/git/kotlin-language-server/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt:85:19 Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public operator fun MatchGroupCollection.get(name: String): MatchGroup? defined in kotlin.text

Edit: Interestingly, the JDK class regression seems to have been introduced with Gradle 8.2, not Kotlin, the language server builds under Gradle 8.2 + Kotlin 1.8, but the tests fail in the same way as with 8.3 + 1.9.10...

Edit 2: Apparently Gradle 8.2 forces the build to use Kotlin 1.8.20 despite us pinning the Kotlin version to 1.8.10 (presumably because Gradle's internal Kotlin DSL now uses 1.8.20?). So it may very well be a Kotlin 1.8.20 regression.

Edit 3: Presumably we have to set JVMConfigurationKeys.JDK_HOME now:

fwcd commented 11 months ago

Thanks!