Open spaceunifyfifty opened 4 months ago
Found this repo https://github.com/alexanderhansen/vscode-remote-try-kotlin, everything works when I create a codespace from it. What is his repo doing right that mine is not?
Caused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2` seems most relevant.
looks suspicious, the SLF4J stuff is fine (should probably add a troubleshooting entry on that). We probably should not be throwing an exception if we cannot find a local Maven repository (maybe make it optional instead?):
Note that support for non-Gradle/Maven projects isn't great yet, mostly because there are so many different ways Kotlin and its standard library could be packaged.
I am also running into this error when attempting to use this plugin inside of a dev container with VSCode. I am using eclipse-temurin:17-jdk-jammy as a base image.
Here is the relevant output from the console:
[Error - 3:09:03 AM] Kotlin Language Client client: couldn't create connection to server. Message: Internal error. Code: -32603 java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: java.lang.ExceptionInInitializerError at org.javacs.kt.classpath.BackupClassPathResolverKt.findLocalArtifactDirUsingMaven(BackupClassPathResolver.kt:88) at org.javacs.kt.classpath.BackupClassPathResolverKt.findLocalArtifact(BackupClassPathResolver.kt:25) at org.javacs.kt.classpath.BackupClassPathResolverKt.findKotlinStdlib(BackupClassPathResolver.kt:21) at org.javacs.kt.classpath.WithStdlibResolverKt.wrapWithStdlib(WithStdlibResolver.kt:42) at org.javacs.kt.classpath.WithStdlibResolverKt.access$wrapWithStdlib(WithStdlibResolver.kt:1) at org.javacs.kt.classpath.WithStdlibResolver.getBuildScriptClasspath(WithStdlibResolver.kt:10) at org.javacs.kt.classpath.FirstNonEmptyClassPathResolver.getBuildScriptClasspath(ClassPathResolver.kt:76) at org.javacs.kt.classpath.CachedClassPathResolver.getBuildScriptClasspath(CachedClassPathResolver.kt:132) at org.javacs.kt.classpath.ClassPathResolver$DefaultImpls.getBuildScriptClasspathOrEmpty(ClassPathResolver.kt:24) at org.javacs.kt.classpath.CachedClassPathResolver.getBuildScriptClasspathOrEmpty(CachedClassPathResolver.kt:52) at org.javacs.kt.CompilerClassPath.refresh(CompilerClassPath.kt:75) at org.javacs.kt.CompilerClassPath.refresh$default(CompilerClassPath.kt:47) at org.javacs.kt.CompilerClassPath.addWorkspaceRoot(CompilerClassPath.kt:120) at org.javacs.kt.KotlinLanguageServer$initialize$1.invoke(KotlinLanguageServer.kt:129) at org.javacs.kt.KotlinLanguageServer$initialize$1.invoke(KotlinLanguageServer.kt:74) at org.javacs.kt.util.AsyncExecutor.compute$lambda$2(AsyncExecutor.kt:19) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ... 3 more Caused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2 at org.javacs.kt.classpath.HomeKt.
(Home.kt:22) ... 20 more
I am attempting to write Kotlin code within GitHub Codespaces, which are just remote ubuntu virtual machines viewed through the web client for vscode. I have tried doing this both for an empty folder structure containing only a
Main.kt
hello world with no Gradle/Maven, and for a pre-existing Gradle project that works on my local machine that I push up to GitHub and create the codespace from; both result in the Kotlin extension giving the errorresulting in no IDE hints / Intellisense.
When I go to the output, the following snippets seem most notable to me
Here is a gist of the full console output.
Has anyone been able to get Kotlin language server in vscode working on a devcontainer / GitHub codespace?
Reproduce steps
README.md
main
branch, with default specs 2-core, 8GB RAM, 32GB.Downloading: kotlin 1.9.22 In progress... ################################################################################################################################################ 100.0% Installing: kotlin 1.9.22 Done installing! Setting kotlin 1.9.22 as default.
Observe error notice