-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
.clang-format file isn't used #604
Comments
Just found #536 which is tangentially (but not exactly) related. It also says that issue is supposed to be fixed in 0.10.4, but my later version is still having this issue. |
Manually specifying the dict for C_Cpp.clang_format_style works, but setting it to "file" doesn't work. |
It's #571 , but I think we'll use this bug to track the issue, since the other bug mostly discusses another issue that I couldn't repro. |
Can confirm this. Just running clang-format from the terminal works fine, VSC ignores it and always uses the fallback. |
same on ubuntu-16.04 & rhel-7.3 + vscode 1.11.1 |
The workaround is to change your clang_format_fallbackStyle to one of the non-"Visual Studio" presets, such as LLVM. But hopefully this will get fixed soon anyway. |
That doesn't work for me but setting C_Cpp.clang_format_path to my system version of clang-format fixes it on macOS. |
@spencersutton Ah, that's probably because your .clang-format has newer fields that aren't supported by the 3.8 version we ship, i.e. different root cause from the Linux/Mac-only issue. |
@sean-mcmanus You're right, I generated my .clang-format with clang-format --dump-config using my system clang-format. I found the version installed by vscode and ran it and got an error. There's no feedback in vscode if there's an error though. It does work with default settings if I take the new option out. |
@spencersutton I agree. We have a work item for exposing the clang-format error messages, but it's not expected to be fixed soon. |
The .clang-format not being detected when the Visual Studio fallback is used will be fixed in the next update. I'm not sure if we'll update the downloaded clang-format version. And we won't be exposing clang-format errors yet. |
I'm having this problem on Windows. The strange thing is I swear it was working earlier. |
@xgalaxy Yeah, we should output the clang-format stderr somewhere. But as a workaround you can just run clang-format via the command line. In your example, TabWidth needs a colon, and FixNamespaceComments was added in clang-format 5.0 and we only ship 3.8-3.9, soon changing to 4.0, but you can change the C_Cpp.clang_format_path to your manually downloaded clang-format 5.0 if you want it to work. |
Crap totally missed the colon. Thank you. |
This was fixed in version 0.11.1. Please reopen if you continue to have this issue. |
Running on Ubuntu 14.04, VSCode 1.10.2 and C++ extension 0.10.5. I seem to be having a similar issue to #196 - the flags passed to clang-format are
-style={ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 2, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0 } -fallback-style=LLVM
which means my actual .clang-format file is not used (should be
-style=file
). Where is this other style coming from and how can I fix it?The text was updated successfully, but these errors were encountered: