This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Stop alignment sequences on open braces and parens when aligning assignments.
ClosedPublic

Authored by berenm on Oct 7 2015, 7:42 AM.

Details

Reviewers
djasper
Summary

This was done correctly when aligning the declarations, but not when aligning assignments.

FIXME: The code between assignments and declarations alignment is roughly duplicated and
would benefit from factorization.

Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090

Diff Detail

Event Timeline

berenm updated this revision to Diff 36742.Oct 7 2015, 7:42 AM
berenm retitled this revision from to [clang-format] Stop alignment sequences on open braces and parens when aligning assignments..
berenm updated this object.
berenm added a reviewer: djasper.
berenm added a subscriber: cfe-commits.
djasper accepted this revision.Oct 7 2015, 8:01 AM
djasper edited edge metadata.

Looks good, thank you.

unittests/Format/FormatTest.cpp
8657

So, it is kind of interesting that we (would) align with a lambda on the next line here, but not with the lambda declaration a few lines above.

I guess this makes sense, but I would also vager that somebody is going to file a bug report about it ;-).

This revision is now accepted and ready to land.Oct 7 2015, 8:01 AM
djasper closed this revision.Oct 7 2015, 8:05 AM

Submitted as r249552.

berenm added inline comments.Oct 7 2015, 8:06 AM
unittests/Format/FormatTest.cpp
8657

Yes, this would require to handle nested levels of alignment sequences and push the current one when a new scope is detected. It's just not implemented yet :)