-
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
Set .clang-format file as fallback #641
Comments
clang-format itself doesn't allow setting the fallback_style to something custom but we could add that feature ourselves, like we did for the "Visual Studio" fallback_style, but allowing arbitrary styles in the same format as the "style" property. E.g. |
I originally meant the second one, but I think your suggestion would be preferable. I noticed this extension doesn't have the source on this repository; is there no way for me to contribute this feature myself? |
Unfortunately, the extension is closed source. |
Well, that's unfortunate. Any particular reason why? Either way, appreciate the responsiveness, and hope to see this feature in a future release! |
See #457 for a discussion on why our extension is not "open source". |
This was added in 0.11.0, but bug #604 will always cause the .clang-format file to not be looked at on Linux/Mac (which we plan to fix "soon"). |
Thank you! It's really useful for me since I'm typically writing a lot of different small c++ projects. |
Why set > "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Always }" |
@rivalak I don't understand what you're asking. Can you open a new issue with more info? |
@sean-mcmanus Sorry to my late. I just cannot use the google format in my vscode by configuring the .clang-format, I don't know why, this really bother me. 😭 |
The .clang-format file should be picked up if it's in the workspace folder or a parent path. It's possible some error is occurring that is causing it to not be used. Can you enable debug logging to see if it shows any errors? What version of clang-format.exe are you using? We currently ship with 6.0 (we should probably update 9.0 after it's released). |
@sean-mcmanus Thanks for your advice. I am using 6.0 version of clang-format. I find "ctrl + shift + I" works well as my wish. And the issues about the format of auto-complete code snippets maybe caused by the 'Intellisense' extension. |
I have a set of formatting options I like to use across projects, but doesn't quite align with any of the provided format. It would be an appreciated feature if I could provide one as a fallback.
I may take a crack at implementing this myself.
The text was updated successfully, but these errors were encountered: