Kakoune with Ubuntu WSL (windows platform) to use clangd with kak-lsp

You are right, correction is has following (I corrected it in the subject too):
from .config/kak/plugins/kak-lsp/ to .config/kak-lsp/

Why ranger.kak has been removed ? This is useful feature to use it.

Configuration file kak-lsp.toml is
filetypes = [“c”, “cpp”]
roots = [".cquery", “compile_commands.json”]
command = “clangd”

There is no event (no more clippy help) when I do lsp-mode -> lsp-compatibilities

clangd doesn’t use .cquery as root indicator

I replaced with

roots = [“compile_commands.json”]

But I have the same behaviour.

Proper config would be:

filetypes = ["c", "cpp"]
roots = ["compile_flags.txt", "compile_commands.json"]
command = "clangd"

I replaced roots line as you advice.
This is not working too with same behavior.
But I don’t yet provide compile_flags.txt under the project.

This was working well with original kak-lsp.toml under Manjaro and now under openSuse (to try because I changed SSD).
That’s why I’m wondering what I could mess trying to use kakoune under WSL.

compile_flags.txt has the same syntax as .cquery except there’s no comments and empty lines

I put compile_flags.txt with

%c -std=gnu11
%cpp -std=gnu++14 -pthread

(no more improvement)

I don’t know how WSL actually structured, so I can’t really help with anything besides configurations of kak-lsp

Don’ t worry and thanks for your help.
Maybe someone else will succeed to use it under WSL.
We will have confirmation that kakoune is also available under Windows.

Hello! It might worth trying to run kak-lsp server manually with debug logging for better understanding of the problem.

Try to do kak-lsp -s mysession -vvv in one terminal, and open file inside your cpp project with kak -s mysession src/path/to/my/file.cpp afterwards in another one. Debug output in the first terminal could have clues for goes wrong.

Hello Andreyorst,
How do you proceed if there is no more ranger command to navigate in your project ?

I never used ranger actually. I use fzf.kak to search and open files in my projects.

@lauccode ranger has been removed because it was too specific.

1 Like

Hello ulis,
I tried but I got no more information.
Opening kak does not do anything.

$ kak-lsp -s mysession -vvv
Apr 23 10:05:04.229 INFO Starting main event loop, module: kak_lsp::session:31

Maybe it could become a ranger plug-in ?
I need to have a look on andreyorst “fzf-project” which seems to be a good candidate to navigate in project.

You can use ranger with Connect.

connect ranger

Decidedly kakoune is resourceful :slightly_smiling_face:

Hello ulis,
Is there a way to check that clangd is responding ?

Kak-lsp seems well set and is running. Kakoune also.

But when I open a cpp file , I can not see the error bar added in the number line columns. It should work even with no files in the root project (compile_flags.txt", “compile_commands.json”).

Yes, the best way to check is to run kak-lsp server manually as I described. May be my instruction was confusing, let me try again:

  1. Open the file with Kakoune in a specific session, e.g. mysession: kak -s mysession main.c
  2. In another terminal kill current instance of kak-lsp and run it with debug logging: pkill kak-lsp; kak-lsp -s mysession -vvv
  3. Switch to Kakoune and edit file or trigger interaction with kak-lsp for this buffer in any other way (e.g. by calling lsp-hover)
  4. Switch back to another terminal and observe kak-lsp logs. They should give a hint about the situation: did kak-lsp succeed to start clangd, what were requests and responses and commands sent to Kakoune etc.

Thanks ulis,
This is well explained. I tried in opensuse and I can trigger interaction.
But there is no event on WSL.
I updated to clangd 8.0.0 without more effects.