In my settings.json file for my project, I have set the following extension settings:
"C_Cpp.clang_format_sortIncludes": true,
"C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false }"
However, applying formatting with Ctrl+Shift+I doesn't honor these settings. It seems as if only the LLVM rule is applying, but not the tab/indentation properties.
The fix will be released in a future update
Did your changes make it into the March 7 release (v0.10.3)?
I ask because one of the issues fixed according to https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
Added enums to the C_Cpp settings so the possible values are displayed in the dropdown.
now shows the following error for the value in my original post regarding "C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false }"
Value is not accepted. Valid values: ["Visual Studio", "LLVM", "Google", "Chromium", "Mozilla", "Webkit", "file"]
However, immediately after that it also says that my example from above is valid -- I believe that message is coming form the comment above the setting in the global settings.json file.
No it was not in that release. Yesterday's release went out mainly to address some issues with the debugger in 0.10.2, and the fix for this issue hadn't gone into the master branch yet when we built the release.
I saw the same warning as you in the json file while testing this. You can safely ignore it. If it is too much of an annoyance I can remove the validation for that field, but that would mean that anyone else editing this property wouldn't get the drop-down list of values to assist them in filling in the value (assuming they want one of the simple built-in options).
Yeah, I think we should remove the enum for this setting, since it can take arbitrary strings.
This should be fixed in 0.10.4. Thanks for reporting the issue.