This was discussed before but the issue I run into is new so I’m asking a new question. The language server started crashing with the message
Client julials quit with exit code 1 and signal 0. Check log for errors: /home/mike/.local/state/nvim/lsp.log
a few weeks ago and I haven’t been able to fix it. Mostly because I get no error outputs in the log so it’s quite difficult to debug to say the least. The lsp.log file is empty even if the got the message above as a notification when trying to start the server.
I use the nvim-kickstart project which I’ve tweaked a bit, but the gist is nvim-lspconfig and mason-lspconfig controls the start of the languageserver.
Basically, when mason-lspconfig migrated to v2, it broke Julia. So for now you have to disable mason-lspconfig for Julia and enable it manually from nvim-lspconfig.
Specifically, the way the Mason folks rewrote the Julia LS launch config to work with the new neovim 0.11+ built-in LSP functionality (which is what the v2 release was about) is built on a subtle misunderstanding of the nvim LSP docs. They didn’t use this approach for any other LS’s, which I guess is why they didn’t realize that it doesn’t work. It’s not hard to fix, just need a sec to try out a couple of alternative approaches and make a PR.
In the meantime, as @jling said, the solution is to not install Julia LS via mason, but rather set it up yourself with the help of nvim-lspconfig. That means
Create a shared Julia environment @nvim-lspconfig and manually install LanguageServer.jl in it: julia --project=@nvim-lspconfig -e 'Using Pkg; Pkg.add("LanguageServer")'
Make sure nvim-lspconfig is installed
Add the line vim.lsp.enable("julials") somewhere in your neovim configuration, for example where you install nvim-lspconfig (if you use lazy.nvim, I’d add it to either the init or opts function in the nvim-lspconfig entry).
Note that vim.lsp.enable(server) doesn’t launch the server, it just tells neovim to automatically launch it once you open a relevant file type, so don’t worry about only running the command conditionally on .jl files or anything like that.
In short, messing around with the various scripts and commands within mason-lspconfigs Julia config to make sure logs were emitted at all levels and noticing that the command that was being launched was the provisional placeholder and not the full command configured inside before_init.