kotlin-language-server
kotlin-language-server copied to clipboard
Problems when using for a compose multiplatform project
When using vscode extension for kotlin, I found several problems.
-
The customized jar dependencies doesn't appear in the project & external dependencies area(left bottom).
-
There is some error when parsing the kotlin source file: [Error - 1:29:42 AM] org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call: remember { mutableStateOf(null) } Method: null File being compiled: (152,9) in //Users/kylewong/Codes/dx-ng/dxng_playground/src/jvmMain/kotlin/com/taobao/dinamicx/dxng/dxng_playground/ui/DemoMVP.kt The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.getMethodNode(SourceCompilerForInline.kt:118) [Error - 1:29:42 AM] at org.jetbrains.kotlin.codegen.inline.InlineCodegen.performInline(InlineCodegen.kt:63) [Error - 1:29:42 AM] at org.jetbrains.kotlin.codegen.inline.PsiInlineCodegen.genCallInner(PsiInlineCodegen.kt:74) [Error - 1:29:42 AM] at org.jetbrains.kotlin.codegen.CallGenerator.genCall(CallGenerator.kt:110) [Error - 1:29:42 AM] at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2759)
-
The jump to definition doesn't work for external jar even there is a corresponding source.jar
-
Don't think support for that on the Kotlin Language Server have ever been implemented... That is only implemented in Java extensions to my knowledge. Unsure if the Java compatbility support extension by @daplf gives some of this as I don't use VSCode. My guess is no.
-
I would scroll WAY UP in the logs to see if any error messages were printed during dependency resolution instead. That error message doesn't really tell me anything other than that an earlier error or bug with dependencies or compilation happened. If you can share your logs at that level, maybe we can find some interesting info helping us solve the issue 🙂
-
I have never gotten jump to definitions to work, so my guess is that they don't, or have very limited support within your project. Never use it as I don't rely upon it, even for big codebases.
Hey 👋
Don't think support for that on the Kotlin Language Server have ever been implemented... That is only implemented in Java extensions to my knowledge. Unsure if https://github.com/fwcd/kotlin-language-server/issues/4#issuecomment-1498370184 by @daplf gives some of this as I don't use VSCode. My guess is no.
Correct. The Java Projects
tab is managed by vscode-java
. The companion extension I worked on doesn't provide this (and it doesn't need to). If you're not using Java, you probably don't need to worry about that. In any case, as far as I recall, vscode-java
supports .gradle.kts
files: https://github.com/eclipse/eclipse.jdt.ls/pull/1849. Maybe it's a problem on their side, idk.
The jump to definition doesn't work for external jar even there is a corresponding source.jar
Jumping to a definition on an external jar works for maven projects (with some exceptions: https://github.com/fwcd/kotlin-language-server/issues/308). For gradle this is not yet implemented.