]> granicus.if.org Git - clang/commit
[clang-format] Fix putting ObjC message arguments in one line for multiline receiver
authorJacek Olesiak <jolesiak@google.com>
Thu, 24 May 2018 10:50:36 +0000 (10:50 +0000)
committerJacek Olesiak <jolesiak@google.com>
Thu, 24 May 2018 10:50:36 +0000 (10:50 +0000)
commitdb9e5e9a616d7fdd4d1ba4c3b2cd89d8a0238533
treedaa656a42543ff573fa33a72d1c22fa945579636
parentc6b61dec4f1388cbe08e1e486af065aeadd3505a
[clang-format] Fix putting ObjC message arguments in one line for multiline receiver

Summary:
Reapply reverted changes from D46879.

Currently BreakBeforeParameter is set to true everytime message receiver spans multiple lines, e.g.:
```
[[object block:^{
  return 42;
}] aa:42 bb:42];
```
will be formatted:
```
[[object block:^{
  return 42;
}] aa:42
   bb:42];
```
even though arguments could fit into one line. This change fixes this behavior.

Test Plan:
make -j12 FormatTests && tools/clang/unittests/Format/FormatTests

Reviewers: benhamilton, krasimir

Reviewed By: benhamilton, krasimir

Subscribers: djasper, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D47195

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333171 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/ContinuationIndenter.cpp
unittests/Format/FormatTestObjC.cpp