coc-clangd icon indicating copy to clipboard operation
coc-clangd copied to clipboard

Specifying clangd version or having a common path

Open akshit-sharma opened this issue 2 years ago • 1 comments

I like to sync my configuration files across different machines using git repository. One of the files, which is shared is coc-settings.json. If machine doesn't have clangd installed, then we can install using CocInstall clangd.install. This creates a folder in ~/.config/coc/extensions/... and adds it to field clangd.path coc-settings.json.

Issue:

If one executes clangd.install on different days on different machines, then they will have different versions of clangd installed (which is fine). But, everytime I sync coc-settings.json, there will be a file conflict due to systems having different clangd versions installed.

"clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/15.0.1/clangd_15.0.1/bin/clangd",

v/s

 "clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/15.0.3/clangd_15.0.3/bin/clangd",

Workaround:

One workaround will be for me to update each machine I have with clangd.install to make sure I have latest version. But that will require me to manually keep track of versions and updating the corresponding machines. This will be hard and I would like an automatic approach.

Expectation:

Is it possible to add a feature (if one doesn't exist) :

  1. to specify particular clangd version to be installed (clangd will be consistent across different machines). or
  2. to make the installed path common for different versions of clangd (that way coc-settings.json will not change across different machines).

If anyone knows better way to synchronize coc-settings.json across different machines, I am open to suggestions.

Thanks

akshit-sharma avatar Nov 04 '22 02:11 akshit-sharma

Hi, sorry for the very late reply, I'm new to this repo. In my testing, if there's a "file conflict" the coc-clangd simply says that clangd wasn't found in your PATH. and running

:CocCommand clangd.install 

fixes it instantly, if you have internet access, I don't think it would be a hassle. However there is an even easier way to do it, install clangd on your local machine and remove the clangd-path variable.

CosmicPegasis avatar Jul 16 '23 19:07 CosmicPegasis