[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 00:00:00 PDT 2025


owenca wrote:

> > > > I prefer that we limit this to breaking after the left parenthesis of a control statement, with true/false or Always, Never, Multiline, BlockIndent, etc.
> > > 
> > > 
> > > if I understand you correctly, you would like a new style option added for setting break option for all control statements in the same way?
> > 
> > 
> > Yes.
> 
> This is basically re-written as requested. The Alignment is determined by the value of AlignAfterOpenBracket, except that because there is a forced break with `MultiLine` the alignment will happen at the Continuation Indent. So using the new option with `MultiLine` and `AlignAfterOpenBracket.Align` is equivalent to using `AlignAfterOpenBracket.AlwaysBreak` with `MultiLine`.

Why would `AlignAfterControlStatement` have anything to do with `AlignAfterOpenBracket`, which is for arguments of function/macro calls?

I'm not sure if we should add this option if it's too complicated to understand. WDYT @mydeveloperday?

https://github.com/llvm/llvm-project/pull/108332


More information about the cfe-commits mailing list