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

C_Cpp.clang_format_style not functioning correctly #536

Closed
freddiehaddad opened this issue Mar 7, 2017 · 5 comments
Closed

C_Cpp.clang_format_style not functioning correctly #536

freddiehaddad opened this issue Mar 7, 2017 · 5 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service

Comments

@freddiehaddad
Copy link

freddiehaddad commented Mar 7, 2017

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.

@freddiehaddad freddiehaddad changed the title C_Cpp.clang_format_style does not functioning correctly C_Cpp.clang_format_style not functioning correctly Mar 7, 2017
@bobbrow bobbrow self-assigned this Mar 7, 2017
@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Mar 9, 2017
@bobbrow
Copy link
Member

bobbrow commented Mar 9, 2017

The fix will be released in a future update

@freddiehaddad
Copy link
Author

freddiehaddad commented Mar 10, 2017

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.

@bobbrow
Copy link
Member

bobbrow commented Mar 10, 2017

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).

@sean-mcmanus
Copy link
Contributor

Yeah, I think we should remove the enum for this setting, since it can take arbitrary strings.

@bobbrow
Copy link
Member

bobbrow commented Mar 15, 2017

This should be fixed in 0.10.4. Thanks for reporting the issue.

@bobbrow bobbrow closed this as completed Mar 15, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants