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

Update clang-format settings to support file: #9786

Closed
EcotechBrad opened this issue Aug 25, 2022 · 2 comments
Closed

Update clang-format settings to support file: #9786

EcotechBrad opened this issue Aug 25, 2022 · 2 comments
Assignees
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@EcotechBrad
Copy link

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.

@sean-mcmanus
Copy link
Collaborator

Thanks for reporting this. The resolving of the ${workspaceFolder} is done in our closed source code -- it should be fixed in 1.13.0.

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 31, 2022
@sean-mcmanus
Copy link
Collaborator

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.0 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

2 participants