[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + sstwcw wrote: > curdeius wrote: > > HazardyKnusperkeks wrote: > > > MyDeveloperDay wrote: > > > > This option is not independen

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread sstwcw via Phabricator via cfe-commits
sstwcw added a comment. @curdeius That would be great. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + curdeius wrote: > HazardyKnusperkeks wrote: > > MyDeveloperDay wrote: > > > This option is not indepen

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @sstwcw, would it help if I created a parent revision that only splits the current enum-based option into a struct, so that you only add compound ops and padding? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119599/new/

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I'd really want to see simpler tests and everything put into a single `AlignConsecutiveAssignment` option. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + HazardyKnusperkeks wrot

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. I think we are going a very good way. Just some steps ahead. Comment at: clang/include/clang/Format/Format.h:157 + /// a &= 2; + /// bbb = 2; + /// sstwcw wrote: > HazardyKnusperkeks wrote: > > sstwcw wrote: > > > H

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-13 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 5 inline comments as done. sstwcw added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:16872 + // that things still get aligned. + Alignment.ColumnLimit = 20; EXPECT_EQ("inta(int x,\n" sstwcw wrote: > curdeius wrote: >

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-13 Thread sstwcw via Phabricator via cfe-commits
sstwcw added inline comments. Comment at: clang/include/clang/Format/Format.h:157 + /// a &= 2; + /// bbb = 2; + /// HazardyKnusperkeks wrote: > sstwcw wrote: > > HazardyKnusperkeks wrote: > > > sstwcw wrote: > > > > HazardyKnusperkeks wrote: > > > > >

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-13 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 408295. sstwcw edited the summary of this revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119599/new/ https://reviews.llvm.org/D119599 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-13 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:157 + /// a &= 2; + /// bbb = 2; + /// sstwcw wrote: > HazardyKnusperkeks wrote: > > sstwcw wrote: > > > HazardyKnusperkeks wrote: > > > > curdeius wrote: > > > >

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread sstwcw via Phabricator via cfe-commits
sstwcw added inline comments. Comment at: clang/include/clang/Format/Format.h:157 + /// a &= 2; + /// bbb = 2; + /// HazardyKnusperkeks wrote: > sstwcw wrote: > > HazardyKnusperkeks wrote: > > > curdeius wrote: > > > > I guess it would be complicated to

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:151 + /// When aligning assignments, whether compound assignments like + /// ``+=``'s are aligned along with ``=``'s. sstwcw wrote: > curdeius wrote: > > You need to upd

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread sstwcw via Phabricator via cfe-commits
sstwcw added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:273 AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End, - unsigned Column, F &&Matches, + unsigned Column, unsigned AnchorWidth, F &&Matche

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 408177. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119599/new/ https://reviews.llvm.org/D119599 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang/Format/Format.h clang/lib/Format/Format.c

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay requested changes to this revision. MyDeveloperDay added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Format/WhitespaceManager.cpp:273 AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End, -

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 408172. sstwcw marked an inline comment as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119599/new/ https://reviews.llvm.org/D119599 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/clang/Fo

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 6 inline comments as done. sstwcw added inline comments. Comment at: clang/include/clang/Format/Format.h:151 + /// When aligning assignments, whether compound assignments like + /// ``+=``'s are aligned along with ``=``'s. curdeius wrote: > You

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:157 + /// a &= 2; + /// bbb = 2; + /// curdeius wrote: > I guess it would be complicated to avoid adding an additional space here. I > mean, it could be: > ``` >

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:468 + // Widths of the aligned text. + // The part to the left of the anchor. For right-justified assignment + // operators, this includes the initial space before the sign but not ---

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + This option is not independent of `AlignConsecutiveAssignments` is it? this will cause confusion when people turn it on

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested changes to this revision. curdeius added a comment. This revision now requires changes to proceed. Thanks for working on this! Looks pretty good already. Comment at: clang/include/clang/Format/Format.h:151 + /// When aligning assignments, whether compound

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-11 Thread sstwcw via Phabricator via cfe-commits
sstwcw created this revision. sstwcw added reviewers: curdeius, HazardyKnusperkeks. sstwcw added projects: clang-format, clang-tools-extra. sstwcw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. About the column limit option in the test Ali