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

#1

I guess kakoune under WSL can be a good solution if we would like to use it under Windows.

Kakoune version has been installed with the git clone
$ kak -version
Kakoune v2019.01.20-203-g06d4ee57

WSL Ubuntu version is
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Clangd version installed with apt-get is
$ clangd --version
clangd version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)

kak-lsp can be launch
$ kak-lsp
Apr 19 10:50:19.208 INFO Starting main event loop, module: kak_lsp::session:31
Apr 19 10:50:19.209 INFO Starting editor transport on 127.0.0.1:31337, module: kak_lsp::editor_transport:106

Debug buffer of kakoune
*** This is the debug buffer, where debug info will be written ***
Dependency unmet: gocode, please install it to use go-tools
Dependency unmet: goimports, please install it to use go-tools
Dependency unmet: gogetdoc, please install it to use go-tools
Dependency unmet: jq, please install it to use go-tools
Config-change detected:

and kak-lsp.toml has been modified and moved from .config/kak/plugins/kak-lsp/ to .config/kak-lsp/

But when I launch a “.cpp” with Kakoune, I don’t see kak-lsp activation.
I should see the error code activation on the number line column.
And other clangd functionnality.

Other strange behaviour is that I can not see the kakoune command :ranger ??

Maybe someone can help ?

Regards

#2

that’s strange location for kak-lsp

There’s no such command in Kakoune anymore.

Perhaps you could provide your configuration files for us to examine. What lsp-compatibilities says?

#3

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
[language.c_cpp]
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

#4

clangd doesn’t use .cquery as root indicator

#5

I replaced with

roots = [“compile_commands.json”]

But I have the same behaviour.

#6

Proper config would be:

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

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.

#8

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

#9

I put compile_flags.txt with

%clang
%c -std=gnu11
%cpp -std=gnu++14 -pthread
-I/work/cquery/third_party
-I/work/cquery/another_third_party

(no more improvement)

#10

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

#11

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.

#12

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.

#13

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

#14

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

#15

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

1 Like
#16

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

#17

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.

#18

You can use ranger with Connect.

connect ranger
#19

Thanks
Decidedly kakoune is resourceful :slightly_smiling_face:

#20

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”).