<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79171>79171</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Strange formatting of chained calls with AlignAfterOpenBracket: BlockIndent
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
flyx
</td>
</tr>
</table>
<pre>
When I use `AlignAfterOpenBracket: BlockIndent` with chained calls, the formatted code looks like this:
```c++
object
.call1(
some, args, that, dont, fit, inline
)
.call2(
some, more, args, given, here
);
```
The idea of `BlockIndent`, at least for me, is to use block indentation *instead of* continuation indentation, but the result here unnecessarily uses both. Also I question why clang-format would break after `)` and `.call2`, this might make sense for other styles but not for `BlockIndent`. I would expect the formatted code to be
```c++
object.call1(
some, args, that, dont, fit, inline
).call2(
some, more, args, given, here
);
```
This might be more relevant for JavaScript formatting where chained calls are more common.
This is technically more of a feature request than a bug report since there isn't a an objective reason why the generated formatting would be wrong, however I do hold the opinion that the intent behind the `BlockIndent` setting is violated by what clang-format currently produces.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVUGP6jYQ_jXmMnooMYEshxygKyR66eFV6tmxJ4mL46H2BB7_vrLD68LuVtoWRTiYmfk83_dlomK0vUdsxHov1q8LNfFAoenc7ceiJXNr_hjQwxGmiCA2xc7Z3u86xvDbGf0-KH1CFqsd7B3p09Eb9Cw2BVwtD6AHZT0a0Mq5KOQvwANCR2FUzGmbDIIjOkVw9oTAg41itRPFqyh-fm-K-dJC7tOVd6n9EzXP9wAAywRQCvnytpU-kUZMqCr0d3TFaTXk89rZvFjvrMe3VCG370rLfy09UniC6O0FfboZMLwrudq_a-mxz98HBGtQAXWJ5WcyMwCDQxU50Qczto3AlHVpUzjYHK_Ykgchd9ZHRmWAOiF3oMmz9dP870NkKtROnJUJGCfH-egweY8aY1TBulsCidASD0vYuUhwhL8mjLnWdbiBdsr332Zh4UqTM9AGVCdQySiQW9gmVyhv0q87qXNnSXUYbT8wjOqEENHH7BIgHjBA5JtL6BODp7n_Dwwt4XjHxR9n1PyZ0Zigxa966xNH_Q83Cbn9xD__wTtf8M0_5LWYK0JAhxflZ6Z-VRf1XQd75p90WN_DNUv89HSCCvd8TeNIfvkBJdkN9eBtir_NsdSBgg4VTxk4myIR40FBO_UQ8EyBIVqv0-OdUG30QtYMCpSHmWx7Sckq3t2UtOvRY1BJu8djz85CuAbyfWaKrnjBAEcwBAM5k5PpbH2yZlIob1jP6BNDg_VzyAcHQcQZxEa4WHIZu73BNdV48reeQkDP7gbnQGbSGJcL06zMdrVVC2zKutgUq2L1Ui-GpqqqVd21lcZtazqpTL02602Lpa6rum71wjaykFVRylVZl9uqXpalquv2BesXjYUxlagKHJV1S-cu45JCv7AxTtjU27IuF0616GIe3VI-nlJImYZ5aFLat3bqo6gKZyPHt0Js2eWx_5S4foXvHJTv8ZF66t7ZJc_3r7wMFlNwzcB8zqNdHoQ89JaHqV1qGoU8pOPcl2_nQHmwy0NuMgp5yH3-HQAA___ZSSGY">