clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
636 stars 113 forks source link

Allow `clangd.path` on `settingsSync.ignoredSettings` #433

Open ruilvo opened 1 year ago

ruilvo commented 1 year ago

Hello,

Since the extension can automatically download and set its own clangd executable, the clangd.path setting ends up a very machine-specific path.

For users - like myself - using settings synchronization, this is an annoyance.

VSCode provides the settingsSync.ignoredSettings feature. But it seems it doesn't work with clangd.path.

When introducing clangd.path into settingsSync.ignoredSettings, the former gets a squiggly line and the following error:

Value is not accepted. Valid values: "editor.tabSize", [....]

The "Valid values" include extension-provided settings, so there seems to be a mechanism by which extension-specific settings can be ignored.

This would be a very appreciated feature.

Thank you.

ian-h-chamberlain commented 5 months ago

As a possible alternative, I would love it if there was a sentinel value that could be used to indicate "use the downloaded clangd", e.g. something like

"clangd.path": {"extensionProvided": true}

or

"clangd.path": {
    "extensionProvided": false,
    "path": "/usr/bin/clangd",
}

If this were the case and the extension could just "figure it out" when extensionProvided was set (instead of updating the configuration when the path changes), I think it would help this use case as well as making the configuration more usable with e.g. source-controlled dotfiles.

I suggested using an object for backwards compatibility (simple string would retain the old behavior), but other options might work too, e.g.

"clangd.path": null,
"clangd.useExtensionProvided": true,