I want the results to look like this:
auto foo = FooBuilder()
.WithSomething()
.WithSomethingElse()
.Build();
but instead cla
Unfortunately, this appears to be not possible. The only option I have found that affects this at all is ContinuationIndentWidth
, which, as you said, doesn't do what you want.
What I personally would do is use the following regex to find chained method calls that have been broken up:
\)\s+\.
It will match a closing parenthesis, 1 or more whitespace characters (but not 0), and a period. You probably don't have too many instances of this, so you could just fix them manually, and then disable clang-format for those lines so it leaves it alone in the future:
// clang-format off
auto friggin_cool_object = SuperCoolBuilder().do_what_i_want()
.figure()
.out()
.the()
.params()
.too();
// clang-format on