[PATCH] D132131: [clang-format] Adds a formatter for aligning trailing comments over empty lines

Yusuke Kadowaki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 10 10:14:04 PDT 2022


yusuke-kadowaki marked 2 inline comments as done.
yusuke-kadowaki added a comment.

Thank you for the detailed explanation. I understood the needs for `unsigned OverEmptyLines` field.
Please review the struct definition first. Then I'll implement the rest of the code.



================
Comment at: clang/include/clang/Format/Format.h:428-433
+    bool operator==(const TrailingCommentsAlignmentStyle &R) const {
+      return Kind == R.Kind && OverEmptyLines == R.OverEmptyLines;
+    }
+    bool operator!=(const TrailingCommentsAlignmentStyle &R) const {
+      return !(*this == R);
+    }
----------------
> I don't understand the need for state as a struct could have multiple options (as enums) each enum should have a state that means "Leave"

@MyDeveloperDay 
Without having state, how can this be implemented?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132131



More information about the cfe-commits mailing list