Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying clangd version or having a common path #523

Open
akshit-sharma opened this issue Nov 4, 2022 · 1 comment
Open

Specifying clangd version or having a common path #523

akshit-sharma opened this issue Nov 4, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@akshit-sharma
Copy link

akshit-sharma commented Nov 4, 2022

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 akshit-sharma added the enhancement New feature or request label Nov 4, 2022
@CosmicPegasis
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants