-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang-format: Add options for SpacesInParentheses #55428
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
Labels
Comments
@llvm/issue-subscribers-clang-format |
I have submitted https://reviews.llvm.org/D155239 to enable the possibility to add these finer-grained controls of space insertion. |
owenca
pushed a commit
that referenced
this issue
Jul 25, 2023
This is a refactoring of: - SpacesInConditionalStatement - SpacesInCStyleCastParentheses - SpaceInEmptyParentheses - SpacesInParentheses These are now options under the new Style Option: SpacesInParens. The existing options are maintained for backward compatibility. Within SpacesInParens, there are currently options for: - Never - Custom The currently available options for Custom are: - InConditionalStatements - InCStyleCasts - InEmptyParentheses - Other Setting InConditionalStatements and Other to true enables the same space additions as SpacesInParentheses. This refactoring does not add or remove any existing features, but it makes it possible to more easily extend and maintain the addition of spaces within parentheses. Related to #55428. Differential Revision: https://reviews.llvm.org/D155239
I have submitted https://reviews.llvm.org/D156360 to add the requested control over spaces inside of function calls vs function declarations. |
gedare
added a commit
to gedare/llvm-project
that referenced
this issue
Jan 9, 2024
This change separates function calls, declarations, definitions, and overloaded operators from `SpacesInParensOptions.Other` to allow control over each independently. Fixes llvm#55428.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Uh oh!
There was an error while loading. Please reload this page.
I am working on a project where function declarations and functions calls are formatted differently:
void foo( Arg x, Arg y ); // decl
foo(a, b) // call
From what I could gather,
SpacesInParentheses
doens't support differentiation. There areSpacesInCStyleCastParentheses
,SpacesInConditionalStatement
, but that' snot enough.I suggest to add something analogous to
BraceWrapping
void foo(A a)
foo(x)
#define FOO( x )
FOO(x)
template<typename T>
Foo<T>
( a + b )
The text was updated successfully, but these errors were encountered: