Code completion and navigation for Kotlin#9428
Conversation
|
I am using kt-mvvm project as a test that the new Kotlin LSP support works. Here are the highlights:
Restarted the IDE and then asked for code completion:
Ctrl+Mouse click navigation works as well. Now I can be happy Kotlin developer! |
|
Thanks for trying @matthiasblaesing...
... I don't think authentication is needed. Certainly my JVM isn't authenticated to GitHub and I am able to successfully: netbeans$ git log | head -n3
commit 0b08fd4428ae9c4790b3d1a2ae741cfa41ece186
Author: Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Date: Sun Jun 7 15:29:29 2026 +0200
netbeans$ rm -rf *; git checkout -f .; JAVA_HOME=/jdk-21/ ant build
netbeans$ JAVA_HOME=/jdk-21 ant trymeand after clicking "Install Kotlin LSP" the download info appears in the log file: After restart (I'll try to remove the need for a restart), the code completion & co. seems to work. |
I am trying, but so far I am getting: |
|
Thanks for working on this. Would love to see Kotlin support included. However, it might be a concern that that language server is marked deprecated? Particularly because it also mentions using internal APIs of the compiler. OTOH, the "official" alternative is currently partly closed source. It gives me some thought that this might be better distributed as a plugin until this settles down. Depends how easy it might be to upgrade this to the alternative in future if/when desired? |
|
FYI fwcd Kotlin LSP is deprecated and there is official Kotlin LSP from JetBrains https://github.com/Kotlin/kotlin-lsp . Unfortunately it is still alpha version. I tried to use both in Netbeans but I returned back to fwcd (mainly because our Kotlin code is pretty old). |
+1
I see https://github.com/fwcd/kotlin-language-server page says: Important There is now an official language server, so this project can be considered deprecated. This is what I get for trying to resurrect some old code. I should have done that years ago! However please note the wording. It is not "deprecated"! It may be "considered deprecated". That's a conditional surrender to superiority of Kotlin creator, not declaration of surrender.
Another indicator fwcd isn't deprecated/useless. It seems to work fine with me.
Changing the server is just about packaging. Once people decide to use the official one, it is just a matter of packaging it. That's easy, but apparently neither me or @Saljack want to do that. We'd rather stick with fwcd in this PR. |
|
There are two parts of this PR:
We want the The other part (e.g. the |
I think it is fine to do that now. I just needs to work 😃 |
|
Funnily enough, just needing to work is one of my concerns! Deprecated and useless are not synonymous, but that repo has open issues about not working on recent JDKs, and hasn't had a release in 18 months or an update in 12. There is an active fork incidentally, at https://codeberg.org/winlogon/ktlsp Although no releases I can see as yet. Something else mentioned there is https://github.com/Hessesian/kmp-lsp So, I'm a little wary of having a hardcoded link to something that might not work across our supported platforms, and also with a GitHub releases link, which while not requiring authentication are also not immutable by default. I just think the plugin option is easier to push an update for in between IDE releases should we need to. OTOH, if released by us it would still require a vote, so perhaps not?! 😄 Also, while probably out of scope directly in this, it feels like that part of this could possibly be generic. We could potentially maintain a registry file with links and hashes for LSP server implementations across mime-types that the IDE could query? |




.ktfiles of my project