Put .query file where I open kakoune: %clang %c -std=gnu11 %cpp -std=gnu++14 -pthread # Includes -I/work/cquery/third_party -I/work/cquery/another_third_party # -I space_is_not_allowed
I open kakoune with kak command in root directory of a cpp github project cloned. The same place where is the .cquery.
I can see all the commands of lsp. But It seems it is not connected to cquery or cquery is not well running.
I tried lsp-capabilities or other commands and nothing seems append.
I also try to start cquery with the sh script here to be sure it is started:
But I got the same as above.
Could someone advice me how to make cquery working with kakoune ? I saw that everybody is using it here.
Thanks Andreyorst
I did all.
Copy ~/.config/kak/plugin/kak-lsp.toml in ~/.config/kak-lsp/
I do the modifications as you. Just replace /home/andreyorst/ with mine.
In kak, I can see the menu with âuser + lâ
But no more event.
What should I see if I select capabilities ?
Also if I do âtopâ in a terminal, I donât see cquery. I was expecting that it is launched by the kak-lsp plugin ?
Iâm under MANJARO
cquery is located here (installed with pacman) /usr/bin/
Now, I can see the interaction with kak-lsp in kakoune.
I believed it was not necessary by reading âYou can replace cargo install âŚâ and it was done automatically by the command âcargo iinstall --force --path .â ?
Now, I can see in debug
Config-change detected:
kak-lsp: c_cpp language server error: â/home/xxxxxxxx/21st-century-pong/src/ball.cpp is being indexed.â
Does it mean that there is something wrong ?
I suppose that youâve installed kak-lsp by manually cloning the repo, and then added the plug.kak config for it. Thatâs not the proper way how to install plugins with plug.kak. Because if you install it via plug-install it will run post-install hooks, which are compilation and installation (if specified). So thereâs no need to place a symbolic link in your /usr/local/bin, instead, you should check where cargo installs kak-lsp and add this folder to $PATH.
My recommendation would be: do :plug-list, move cursor to kak-lsp plugin in the list and press D â this will delete plugin. Next press I or Return â this will install kak-lsp and post install hooks will be executed. Wait until it is compiled and installed (youâll see the done message), and press L. Installation log will be opened. At the bottom youâll see where cargo had installed kak-lsp. Add this path to your $PATH.
I followed your recommendations and it is working as well.
I âunlinkâ the symbolic link before and add the PATH "~/.cargo/bin/kak-lsp " that I saw in the log as advised. Maybe it can be added in the wiki of kak-lsp ?.
Now, I will need to improve the database with compile_commands.json instead of â.cqueryâ.
Thanks for your help Andreyorst.
The update of the plug.kak is very nice and useful.
Thanks, itâs greater with plug.kak
At the moment, could we have highlight tags and call-hierarchy with kak-lsp ?
I saw that tagbar is giving a lot of information too.
for some reason it didnât work for me. Server was initialized, lsp capabilities were fine, but neither completions nor diagnostics worked. Perhaps some compatibility issue with kak-lsp. clangd worked ootb like a charm on the other hand.
The only downside of clangd Iâve noticed so far is that it doesnât display define value on hover. Not sure why they decided not to do that, cquery showed it just fine. Thatâs also the case for ctags, it doesnât store define value in tags file for some reason, perhaps because of multi-line macros, but still is strange design choice to me to ignore them all the way
Right, so, I switched to clangd too in kak-lsp.toml and you are right it is working better.
Even the missing âhighlightâ is working. Do you think rtags could be better (with call hierarchy) and should be used with kakoune for c++ ?
Thanks
At the moment, could we have highlight tags and call-hierarchy with kak-lsp ?
I think LSP protocol doesnât support call hierarchy atm, but you can search for references with lsp-references. Highlighting usages should work with lsp-highlight-references (and you also can do set buffer lsp_auto_highlight_references true) if the language server supports them.
I have problem with cquery as well. As this thread is first to pop-up in search engines I thought it will be good to keep all solutions in one place. If itâs better to create new thread, let me know.
I have everything configured as you adwised ( my configs: https://github.com/siriKeeton/kakrc ), both kak-lsp and cquery are in $PATH.
Running cquery outputs: