ghvg1313 marked 2 inline comments as done.
ghvg1313 added inline comments.

================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:869
       State.Stack[i].BreakBeforeParameter = true;
 
   if (PreviousNonComment &&
----------------
ghvg1313 wrote:
> MyDeveloperDay wrote:
> > I'm a little confused by the code, this feels to me like its covering 
> > something more than a specific than just the ObjectiveC case, what is meant 
> > here by a nestedblockspecialcase? this feels like we are turning off 
> > BreakBeforeParameter by another method?
> > 
> > I get the code below, just wondering why this is also needed.
> I think you are right, bin packing is already avoided as the comment says so 
> I don't have to do anything extra.
> 
> Was trying to handle linebreaking within block as well. Not needed indeed.
Notice I get this back again, it's actually to avoid parameter break in between 
blocks, so we don't get inconsistent parameter break between blocks, for 
example: 
```
- (void)_aMethod
{
    [self.test1 t:self
                    w:self
         callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
             u = c;
         } x:self callback2:^(typeof(self) self, NSNumber *u, NSNumber *v) {
             u = c;
         }]
}
```

Originally, the second block will trigger the parameter break in between itself 
and the previous block.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70926/new/

https://reviews.llvm.org/D70926



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to