xaverh/vscode-clang-format

clang-format.executable in settings.json does not work with vscode 1.63.2

maestudillo opened this issue · 1 comments

Hi all,

I am trying to set clang-format.executable in settings.json to look for clang-format executable path, but it does not work.

My current vscode version is 1.63.2

Is there any way to configure in settings.json a relative path to the project where it is clang format executable?

Thanks in advance

One point of interest here is that the configuration specification for the clang-format.executable preferences in this repo is incorrect. Although preferences in settings.json are keyed on long, .-separated strings, internally VSCode turns them into an object tree. That means that VSCode can't / won't handle a.b with a value and a.b.* with a value, so this is impossible:

"clang-format.executable": {
"type": "string",
"default": "clang-format",
"description": "clang-format executable path"
},
"clang-format.executable.windows": {
"type": "string",
"default": "",
"description": "clang-format executable path on Windows"
},
"clang-format.executable.linux": {
"type": "string",
"default": "",
"description": "clang-format executable path on Linux"
},
"clang-format.executable.osx": {
"type": "string",
"default": "",
"description": "clang-format executable path on macOS"
},

It appears that VSCode is accepting clang-format.executable and ignoring clang-format.executable.* - they don't appear in the settings UI, and they don't appear in the schema used for the settings.json file:

image

image

image