clangd / coc-clangd

clangd extension for coc.nvim
Apache License 2.0
753 stars 34 forks source link

launch server clangd using command failed #678

Closed Elite-zx closed 4 months ago

Elite-zx commented 4 months ago

My clangd has been running very well. However, after I ran the command clangd.install, I encountered the following issue.

image

My coc-settings are as follows:

image

my system aleady install clangd, and works fine :

image
fannheyward commented 4 months ago
  1. you don't need to setup clangd in coc-settings.json when using coc-clangd
  2. your first screenshot shows the clangd v18.1.3 couldn't run on your OS, maybe this version is not compatible, you can manually install clangd, and set clangd.path in your coc-settings.json to be used by coc-clangd.
Elite-zx commented 4 months ago

which clangd /usr/local/bin/clangd

What should be done specifically, my coc-settings.json :

image

the problem still exists

fannheyward commented 4 months ago

Put clangd.path in the root section

image
Elite-zx commented 4 months ago

same error when I open .cpp file:

image

my coc-settings.json :

image

CocInfo:

versions

vim version: VIM - Vi IMproved 8.2 8022520 node version: v17.9.1 coc.nvim version: 0.0.82-c3ae5c3b 2024-05-23 20:39:40 +0800 coc.nvim directory: /data/zenonzhang/.vim/plugged/coc.nvim term: dumb platform: linux

Log of coc.nvim

2024-06-05T20:12:51.742 INFO (pid:12826) [plugin] - coc.nvim initialized with node: v17.9.1 after 181 2024-06-05T20:12:52.974 INFO (pid:12826) [services] - LanguageClient clangd state change: stopped => starting 2024-06-05T20:12:52.979 INFO (pid:12826) [services] - LanguageClient clangd state change: starting => stopped 2024-06-05T20:12:52.980 ERROR (pid:12826) [services] - Server clangd failed to start: Error: Launching server "clangd" using command ../../../.config/coc/ extensions/coc-clangd-data/install/18.1.3/clangd_18.1.3/bin/clangd failed. ¦ at /data/zenonzhang/.vim/plugged/coc.nvim/build/index.js:75028:37 ¦ at async LanguageClient.createConnection (/data/zenonzhang/.vim/plugged/coc.nvim/build/index.js:74368:28) ¦ at async LanguageClient._start (/data/zenonzhang/.vim/plugged/coc.nvim/build/index.js:73999:30) ¦ at async Object.start (/data/zenonzhang/.vim/plugged/coc.nvim/build/index.js:75518:17) 2024-06-05T20:12:57.048 INFO (pid:12826) [attach] - receive notification: showInfo []

this annoying problem occured after I run clangd.install @v@

fannheyward commented 4 months ago

You can remove this ~/.config/coc/ extensions/coc-clangd-data/install/18.1.3/clangd_18.1.3/bin/clangd.