I’m attempting to set up the clojure-lsp language server for use with kak-lsp. I don’t know for sure whether this is even possible, but if it is, it would be great to get it working.
Link to clojure-lsp, the language server for Clojure:
So far, I’ve successfully managed to set up kak-lsp for c/cpp with clangd, so that much is working.
I installed kak-lsp via plug.kak as follows (based on andreyorst’s dotfiles):
plug "ul/kak-lsp" do %{
cargo build --release --locked
cargo install --force --path .
} config %{
set-option global lsp_diagnostic_line_error_sign "!"
set-option global lsp_diagnostic_line_warning_sign "?"
hook global WinSetOption filetype=(c|cpp|clojure) %{
map window user "l" ": enter-user-mode lsp<ret>" -docstring "LSP mode"
lsp-enable-window
lsp-auto-hover-enable
lsp-auto-hover-insert-mode-disable
set-option window lsp_hover_anchor true
set-face window DiagnosticError default+u
set-face window DiagnosticWarning default+u
}
hook global KakEnd .* lsp-exit
}
I copied the default kak-lsp.toml from the plugin install directory into ~/.config/kak-lsp/kak-lsp.toml, and am modifying it there. I’ve tried a few different things, but the relevant config for the Clojure server is currently as follows:
[language.clojure]
filetypes = ["clojure"]
roots = ["project.clj", "deps.edn", ".git"]
command = "clojure-lsp"
This config is an educated guess. It seems fairly straightforward, but an explicit explanation on what should go on each line could be helpful.
Following the debugging strategy given in this post, I’m receiving the following output, which seems revealing, but I don’t know enough to act on it:
Jul 09 16:05:12.657 INFO Starting main event loop, module: kak_lsp::session:29
Jul 09 16:05:27.373 INFO Starting Language server `clojure-lsp `, module: kak_lsp::language_server_trans
port:21
Jul 09 16:05:27.374 ERRO panic: panicked at 'Failed to start language server: Os { code: 8, kind: Other,
message: "Exec format error" }', src/libcore/result.rs:1188:5, module: kak_lsp:252
Jul 09 16:05:27.376 INFO Waiting for Controller to finish..., module: kak_lsp::thread_worker:18
Jul 09 16:05:27.383 INFO ... Controller terminated with err, module: kak_lsp::thread_worker:20
Jul 09 16:05:27.384 ERRO panic: panicked at src/thread_worker.rs:29:17, module: kak_lsp:252
Jul 09 16:05:27.384 INFO Waiting for Messages to editor to finish..., module: kak_lsp::thread_worker:18
Jul 09 16:05:27.385 INFO ... Messages to editor terminated with ok, module: kak_lsp::thread_worker:20
Any insight into how I might proceed here, or in regards to configuring non-default language servers in general would be appreciated.
Thanks in advance!