[clang-format] Don't break multi block parameters on ObjCBreakBeforeNestedBlockParam
authorKanglei Fang <kanglei@uber.com>
Mon, 6 Apr 2020 19:45:38 +0000 (12:45 -0700)
committerJin Lin <jinl@uber.com>
Mon, 6 Apr 2020 21:20:09 +0000 (14:20 -0700)
commit28ecd7f0b0865878a12d814a6d0de92cb7529d22
tree0ba6209bfd5ff128b18ea4c53675243314827f38
parent836534f9970295ff559ef49d6c49958aac6171f9
[clang-format] Don't break multi block parameters on ObjCBreakBeforeNestedBlockParam

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
clang/docs/ClangFormatStyleOptions.rst
clang/lib/Format/ContinuationIndenter.cpp
clang/unittests/Format/FormatTestObjC.cpp