-
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-formatter don't allow work another code formatter #303
Comments
My guess is that vscode picks an extension to go with somehow. @sean-mcmanus, do you know a way to get this to work? |
@astand, currently our extension does not provide a way to turn off the code-formatting feature that's built into it. This is something that we will definitely consider for our next release as VSCode overall does not provide an ability to force the order of extensions being used. Therefore if there are two extensions loaded that have similar functionality, only one of them will win. That being said, is there something in particular about the other formatter your using that you like or something in particular about our formatter that you find lacking? |
@greazer, I am using astyle extension, I used it before vscode and it is very familiar to me. |
@delmyers When two matching formatters for a language are available VS Code picks the one that came last. This isn't ideal, for October we are working on resolving this, and we also need your support here. After a long thought process and weighing options we agreed on adding settings for our formatters, like Our ask for you guys would be to add a setting ala |
@jrieken Thanks, we'll be adding this switch to our extension. Most likely our next release. |
@astand Oh, it's also important to not set C_Cpp.clang_format_style at all, or set it to "file" in order to make our formatter look for the .clang-format file. This may be the source of the problems you're having since it sounds like you're trying to set the path the .clang-format file using that option. That won't work. |
@greazer Thanks, i've got it. I deleted wrong settings (all related to c_cpp.clang_*) and added ".clang-format" file to source code dir. It has only one string - {BasedOnStyle: Visual Studio}. Predefined style - "Visual Studio" but formatter applies another style (I guess that it is LLVM) . When I delete ".clang-format" file, formatter uses Visual Studio style. |
@delmyers Any update on this? Can we help with the change? |
Yeah, an update with the formatter enable/disable option is planned to be released soon in 0.9.3. |
It doesn't look like this made it into 0.9.3? Any idea when it will? It's a bit of a dealbreaker for me - I'd love to use this extension, but my legacy codebase is not consistently formatted, and I don't want to make wholesale formatting changes unnecessarily. It seems a bit crazy not to allow formatting to be disabled in some way or other... |
Yes, it has not any changes in this problem. VS code makes things simpler ( I may enable/disable my formatter and it is again in work state), but it is no much less annoying. |
We're releasing an update with the fix today, unless something unexpected happens. |
Thanks, It's working! |
After installing extension my previous formatter has stopped working. I really don't know how force to work extension and other formatter together? Is there some method? ("C_Cpp.clang_format_fallbackStyle": "none" - not works)
The text was updated successfully, but these errors were encountered: