[Multiplatform + Neovim + VSCode] Performance, unresolved references, errors
See original GitHub issueHello, thank you for the work on this server. Trying to make it work with Neovim. Iβm using Intellij IDEA maaaany years and the project I testing now works in IDEA beautifully. So I suppose I need to somehow setup the server if I want to use it with Neovim. I filling this issue with multiple problems because I think that all issues related to one thing that Iβm missing. If itβs not the case, tell me to create multiple small issues or to read docs:)
Prerequests:
- Neovim 0.7.0
- Plugin https://github.com/neovim/nvim-lspconfig with Kotlin config: https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/kotlin_language_server.lua
- LSP installer in use: https://github.com/williamboman/nvim-lsp-installer/
- Archlinux x86_64
- 4 cores & 16 GB RAM (cloud)
- installed kotlin via
pacman -S kotlin
- installed gradle with
pacman -S gradle
Issues I have:
Overload resolution ambiguity
Itβs a main problem. The main thing for KMPP is not working properly. While Goto reference
works perfectly within MY common/native/Android code. The server able to find reference to a function from different source set.
Unresolved references
Third-party libraries donβt work. While all of them work in Intellj IDEA.
Low performance
After reopening vim (closing vim and reopening it again) on the same file I worked before it takes 4-8 minutes to see first error highlighting. All this time CPU almost on max. Memory usage increases from 1G to 4-5GB easily (numbers without including Gradle memory usage). Almost all CPU usage from the server, not Gradle.
When the server started (for the moment when I see highlighted errors), I try to edit something. So I just removing a piece of code to make the server showing an error. Error is not highlighted even after a couple of minutes. In IDEA it takes 2-3 seconds on a long file.
Screenshot after 3 minutes of loading the project:
Video about not highlighted error in a code after making an error:
https://user-images.githubusercontent.com/7953703/181840048-035db041-e1d4-471e-bff3-c42d0edab302.mp4
Project structure:
.
βββ android
β βββ build.gradle
β βββ src
β βββ main
β βββ test
βββ build.gradle
βββ common
β βββ build.gradle
β βββ src
β βββ androidMain
β βββ commonMain
β βββ desktopMain
β βββ jvmMain
βββ core
β βββ build.gradle
β βββ gradle
β β βββ wrapper
β βββ gradle.properties
β βββ gradlew
β βββ gradlew.bat
β βββ src
β βββ commonMain
β βββ commonTest
β βββ jvmMain
β βββ nativeMain
βββ desktop
β βββ build.gradle.kts
β βββ src
β βββ jvmMain
βββ gradle
β βββ wrapper
β βββ gradle-wrapper.jar
β βββ gradle-wrapper.properties
βββ gradle.properties
βββ gradlew
βββ gradlew.bat
βββ local.properties
βββ settings.gradle
settings.gradle
rootProject.name = 'MyProject'
include ':core'
include ':common'
include ':android'
include ':desktop'
What am I doing wrong?
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:14 (7 by maintainers)
Donβt underestimate how stubborn I can be π I ended up playing with the ktor chat example for now. I think I will soon have a working solution for resolving dependencies in kotlin multiplatfor projects, but it needs some more testing. The current solution I have implemented needs some tweaking to work, as it is far from perfect. Hope to get a PR done by this evening.
Those are really fun to play with indeed π Iβve been wanting to go through the How To Solve It book my George Polya, and solve it in Haskell. Heard from someone long ago that it was really fun to do so. There is too much fun stuff to do for me to have time for everything π
I cloned this repo (
kotlin-language-server
), opened nvim inside, got an error about missing maven, installed maven, reopened nvim, the project opened successfully. No errors, fast errors displaying after making some (right after living insert mode, even without delay). I was impressed.Then I opened Keymapper project. Iβm now much older than I was when did so. Project setup takes centuries. I stopped counting my age:) I mean,
Indexing
stage took more than an hour and still being indexing. Closed it, run./gradlew assemble
. Turns out I need to accept licenses as you are. Did it.Now I got this error in lsp log file:
First result in search is this: https://stackoverflow.com/questions/64834818/android-studio-could-not-get-unknown-property-kotlin-version
Results from this repo: https://github.com/fwcd/kotlin-language-server/search?q=kotlinVersion
Maybe after adapting language-server source code to suggestions from SO result will be better.
But at least itβs something new. Which means installing maven helped somehow.
There are so many lines in the lsp log (more than 160000), almost all of them about
Back-end (JVM) Internal error
when I try to open my projects.Regarding sample
chat
, the log starts with this:After that multiple errors related to different things. In nvim itβs still canβt find
Kotlin.Unit
and others.As I said, better donβt. To fully build the lib, you need to install Haskell, nix package manager, build GCC from source (which is a part of Nix build process), setup CMake and so on. It will take at least one day of your time. Would be better to get results with
chat
sample (since itβs multiplatform and have a small codebase, while simplex-chat is not multiplatform). But itβs your choice, of course. Maybe playing with Haskell and Nix will be interesting for you (as from the mathematics perspective) π