In Visual Studio Code with the clang extension, when I try to format document, the formatting ignores the .clang-format file in the workspace (located 2 levels above the folder of the file I am trying to format).
The result of the formatting looks very different from the one I get if I run clang-format manually from the vscode terminal window.
The settings I use are (some irrelevant ones omitted for brevity):
{
"[cpp]": {
"diffEditor.codeLens": true,
"editor.tabCompletion": "on",
"editor.tabSize": 4
},
"clangd.arguments": [
"--enable-config"
],
"C_Cpp.clang_format_path": "/opt/homebrew/bin/clang-format",
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
"C_Cpp.default.browse.path": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1"
],
"C_Cpp.default.compilerPath": "/opt/homebrew/opt/ccache/libexec/clang++",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cStandard": "c99",
"C_Cpp.intelliSenseEngine": "Disabled",
"C_Cpp.formatting": "clangFormat",
"C_Cpp.loggingLevel": "Warning",
"clangd.checkUpdates": true,
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.tabCompletion": "on"
}
What am I missing?