LanguageServer.jl or kak-lsp

Hello,
I followed the instructions here:

but when opening a file I obtain the error message:
“error during startup, see debug buffer for details”

I would like to know how I can see the debug buffer
and in which location is placed the file kakrc mentioned in the instructions.
I have Debian installation with apt-get, so I had to edit this file as root but I do not know if there is another similar file for normal users.

What could be causing this problem?

I would like to add that I have also found another file named kak-lsp.toml so there are two files
with the same name in total:
./home/mmestre/kak-lsp/kak-lsp.toml
./home/mmestre/.config/kak-lsp/kak-lsp.toml (the one built by me following the tutorial )
They both containt different things inside.

Thank you very much,
Tincho

While I’m not a core contributor to kak-lsp, I’ll try to help if I can. Addressing your concerns one by one:

Kakoune’s debug buffer is accessed by typing :buffer *debug* in normal mode. This will open up the debug buffer with details on the error you saw.

The kakrc those instructions are referring to is the file that should be located at ~/.config/kak/kakrc. The file that is distributed with Kakoune performs some important setup, such as loading all files within the ~/.config/kak/autoload directory (if it exists), so it’s not recommended to change it.

As for the duplicate kak-lsp.toml files: the one in the repo represents the default configuration that’s used if there is no ~/.config/kak-lsp/kak-lsp.toml file. Defining a ~/.config/kak-lsp/kak-lsp.toml file will overwrite this default configuration.

Finally, here are some concerns you didn’t mention outright but may cause problems with your setup:

  • The plug command the instructions tell you to place in your kakrc comes from a plugin manager called plug.kak: GitHub - andreyorst/plug.kak: Plugin manager for Kakoune. I would recommend following the installation instructions there to ensure this command works as intended. This is likely the source of the errors you were seeing.
  • After getting plug.kak sorted, restart Kakoune and run :plug-install. This will automatically install kak-lsp, assuming you have a recent enough version of Rust installed.

I get that that’s probably a wall of text, but I hope it helps.

1 Like

Note that if you don’t create a kak-lsp.toml, then kak-lsp will just use the default one, which is also good enough for this case.

You usually shouldn’t edit the system-wide /usr/share/kak/kakrc (which requires root privileges) - so rather use ~/.config/kak/kakrc

As alternative to the kakrc snippet in your link, you can also just use this snippet instead (assuming you have kak-lsp in your $PATH)

evaluate-commands %sh{kak-lsp -s $kak_session --kakoune}
lsp-enable

That should be enough to make basic things work. It can take a while to start up. If it doesn’t work, and there is no error in the *debug* buffer, then create a log (there’s an example in the wiki entry).

1 Like