Julia LSP refuses to work

Hello. I am using neovim mostly for coding in julia. Sadly, the julia LSP does not work. Every time I open a julia file I get the message “Client X quit with exit code 1 and signal 0”, and the LSP is dead. I have searched the Internet far and wide and spend way too much time trying to fix this, but so far have found no solution that worked.

My setup

  • Ubuntu 23.04
  • Neovim 0.9.1 (snap store)
  • Julia 1.9.3 (snap store)
  • LanguageServer.jl 4.4.0
  • Config: personalized setup based on kickstart. Irrelevant to the problem, I suspect (see below)

What I have tried so far

  • updating node, npm
  • uninstalling nvim, deleting all of
    • .cache/nvim
    • .config/nvim
    • .local/share/nvim
      reinstalling nvim, downloading kickstart.nvim, installing julials via Mason
  • installing a fresh sandbox Ubuntu on a usb stick, installing only nvim, julia, gcc and kickstart.nvim

The problem persisted with all of the above

More details

I do not think that my nvim config itself is the problem, because a) the exact same setup on a different machine (running windows) works fine, and b) switching out my config for plain kickstart.nvim changed nothing. Let me know if you think otherwise.
Interestingly, I know that the JuliaLS is installed and functioning correctly too, because if I start Jupyter and open a cell via firenvim, the juliaLSP starts and works just fine (and downloads the entire symbol cache for each cell). But upon opening a regular .jl file the LSP immediatly dies.

Given the above (works on windows and jupyter cells) I suspect the LSP starts up, tries to scan my project/directory and then somehow crashes. I am not sure if this is a problem for the neovim or the julia forum, but I decided to start here.

Any help is welcome.

I’ve haven’t used the Julia language server, so I can’t offer specific advice, but you might get some useful crash information from running :LspLog and scrolling to the bottom.

Hopefully investigating that output will help. If not, perhaps posting it here will allow someone to suggest fixes.

Good luck!

Hi. I did what you said, run :LspLog, here is the result:

[START][2023-09-23 21:35:36] LSP logging initiated
[ERROR][2023-09-23 21:35:36] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"  Activating"
[ERROR][2023-09-23 21:35:36] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	" project at `~/.local/share/nvim/mason/packages/julia-lsp/libexec/extension/scripts/environments/languageserver/v1.9`\n"
[ERROR][2023-09-23 21:35:36] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Starting the Julia Language Server\n"
[ERROR][2023-09-23 21:35:37] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Symbol server store is at '/home/almighty-admin/.local/share/nvim/mason/packages/julia-lsp/libexec/store/symbolstorev5'.\n"
[ERROR][2023-09-23 21:35:38] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Starting LS at 1695497738\n"
[ERROR][2023-09-23 21:35:42] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Downloading cache files... (0%)\n"
[ERROR][2023-09-23 21:35:43] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Downloading cache files... (17%)\n[ Info: Downloading cache files... (33%)\n[ Info: Downloading cache files... (50%)\n[ Info: Downloading cache files... (67%)\n[ Info: Downloading cache files... (83%)\n"
[ERROR][2023-09-23 21:35:43] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: All cache files downloaded (took 0.16s). (100%)\n"
[ERROR][2023-09-23 21:35:45] .../vim/lsp/rpc.lua:734	"rpc"	"/home/almighty-admin/.local/share/nvim/mason/bin/julia-lsp"	"stderr"	"[ Info: Indexing GLMakie... (0%)\n"

Some Context: These “Errors” we see at the end there (“Info: Downloading cache files…”, “Info: Indexing GLMakie…”) are not really errors but rather regular julials behavior, that nvim for some reason interprets as error messages (They also appear in the fidget). They also stem not from all the crashed Clients, but from the Jupyter nvim-cells that have properly functioning LSPs running. The crashing clients do not leave a single trace in the LspLog file (I checked multiple times).

Update: my windows machine (where LSP is running fine) prints its status updates to the nvim error logs as well. This appears to be just normal julia-ls behaviour!?

In case someone with the same problem stumbles across this thread, since things did not really move here I reposted my problem over at the julia forum, and someone there gave me the hint that fixed it.

Apparently the binaries from the snap store are incapable of hosting a proper LanguageServer instance. I purged my snap store julia install and reinstalled everything via juliaup, now julials runs fine. The reason for this behavior is beyond me, but now it works , I guess… :person_shrugging:

1 Like