vscode-clangd
vscode-clangd copied to clipboard
Default .Clang-Format options
In Microsoft's C/C++ extension, this is possible via the C_Cpp.clang_format_fallbackStyle
setting. It'd be nice if clangd could have the same because it's annoying to configure a .Clang-Format
for every project I make, especially for the small one-off projects that don't involve collaboration. Thank you for considering my request!
I'm confused why this is named .Clang-Tidy when you are asking about clang-format. Anyway you can pass the command line flag --fallback-style=<>
to provide a default formatting. AFAIK this only supports the built in styles(LLVM, Google, Mozilla, Webkit, GNU, Microsoft, Chromium or None).
Or put .clang-format in your home directory?
I'm confused why this is named .Clang-Tidy when you are asking about clang-format. Anyway you can pass the command line flag
--fallback-style=<>
to provide a default formatting. AFAIK this only supports the built in styles(LLVM, Google, Mozilla, Webkit, GNU, Microsoft, Chromium or None).
My bad, I meant to write .Clang-Format
! This would require putting the flag in the .vscode/compile_commands.json
file for every project, no? Sorry, I'm new to this extension.
Or put .clang-format in your home directory?
Ah, that works. Thanks for the suggestion. :)
Or put .clang-format in your home directory?
Ah, that works. Thanks for the suggestion. :)
I'm having the same issue, but in my case, placing .clang-format
on C:/Users/${Username}/
isn't solving it.
Or put .clang-format in your home directory?
Ah, that works. Thanks for the suggestion. :)
I'm having the same issue, but in my case, placing
.clang-format
onC:/Users/${Username}/
isn't solving it.
That trick only works if all the projects you are working on are in a subdirectory of your home folder. If, for example, you have a project stored on another drive then it won't be found.
Another windows caveat is it likes to hide part of the filename so you need to be sure there is nothing hidden and it's named exactly .clang-format
.