Summary:
While [the original diff](https://reviews.llvm.org/D42493) makes a lot of sense, and multiple inline block parameter/trailing paramemter after inline block paramemter should be discouraged, the formatting result is different than what xcode does by default
For the exact same example provided in the original diff:
```
[object
blockArgument:^{
a = 42;
}
anotherArg:42];
```
The code is hard to read and not very visually pleasing
This diff uses `ObjCBreakBeforeNestedBlockParam` to shield from the formatting
When it's set to false, don't allign the inline block paramemters.
Reviewers: jolesiak, benhamilton, jinlin
Reviewed By: jolesiak
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77039
- (void)_aMethod
{
[self.test1 t:self
- w:self
- callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
+ w:self
+ callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
u = c;
}]
}
if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection)
return true;
if (Style.Language == FormatStyle::LK_ObjC &&
+ Style.ObjCBreakBeforeNestedBlockParam &&
Current.ObjCSelectorNameParts > 1 &&
Current.startsSequence(TT_SelectorName, tok::colon, tok::caret)) {
return true;
"*b, NSNumber *c) {\n"
" b = c;\n"
"}]");
+ verifyFormat("[self.test1 t:self w:self callback:^(typeof(self) self, "
+ "NSNumber *u, NSNumber *v) {\n"
+ " u = v;\n"
+ "} z:self]");
Style.ColumnLimit = 80;
verifyFormat(