[PATCH] D93986: [clang-format] Add the possibility to align assignments spanning empty lines or comments

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 4 12:28:51 PST 2021


HazardyKnusperkeks requested changes to this revision.
HazardyKnusperkeks added a comment.
This revision now requires changes to proceed.

In D93986#2477474 <https://reviews.llvm.org/D93986#2477474>, @tinloaf wrote:

> In D93986#2477383 <https://reviews.llvm.org/D93986#2477383>, @MyDeveloperDay wrote:
>
>> Ideally we should add a comment to the release notes, (which you could do via a separate NFC commit if you wanted)
>
> Thank, I'll do that. But before that, I will create a revision that adds the same feature for the other three alignment types.

I think it should happen in this revision so that it is atomically.

But I'm willing to be overruled.

Apart from the 2 comments and the release notes nice change! (And I really have to think about what my new setting will be.)



================
Comment at: clang/include/clang/Format/Format.h:117
+    ///   int b    = 23;
+    ///
+    ///   int ccc  = 23;
----------------
You are adding a Tab here, or do I misinterpret this? Shouldn't that be fixed by clang-format itself?


================
Comment at: clang/lib/Format/WhitespaceManager.cpp:630
 void WhitespaceManager::alignConsecutiveAssignments() {
-  if (!Style.AlignConsecutiveAssignments)
+  TokenAlignmentStyle tas;
+  switch (Style.AlignConsecutiveAssignments) {
----------------
All other variables start with an upper case char, maybe we should keep it that way?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93986/new/

https://reviews.llvm.org/D93986



More information about the cfe-commits mailing list