vscode-cpptools
vscode-cpptools copied to clipboard
Update clang-format settings to support file:
Feature Request
in Clang-format v14 you can specify a file path using -style=file:<path-to-file>
however, variable expansions do not work in setting "C_Cpp.clang_format_style"
i.e something like "C_Cpp.clang_format_style": "file:${workspaceFolder}/tools/.clang-format" is not expanded, and returns
Formatting failed: "C:\Program Files\LLVM\bin\clang-format.exe" -style=file:${workspacefolder}/tools/.clang-format
if someone could point me to where variables like clangFormatPath are expanded i could open a PR myself,
i've already tried adding util.resolveVariables
in client.ts mimicking settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment));
commit: 5d736cc6c8e07be89b1b79a2ceb124243304a434 file client.ts line 1125
settings_clangFormatStyle.push(util.resolveVariables(setting.clangFormatStyle, this.AdditionalEnvironment));
however no luck.
Thanks for reporting this. The resolving of the ${workspaceFolder} is done in our closed source code -- it should be fixed in 1.13.0.
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.0 .