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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 3 22:53:29 PST 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:130
+    /// \endcode
+    ACA_AcrossComments
+  };
----------------
tinloaf wrote:
> MyDeveloperDay wrote:
> > Is there a case for aligning over empty lines and comments?
> > 
> > ```
> > int a           = 5;
> > 
> > /* comment */
> > int oneTwoThree = 123;
> > ```
> Not sure I understand what you mean. Currently, the Option `AcrossComments` includes 'across empty lines'. So, there currently is no case for "across comments, but not across empty lines". I'm not sure if that is really something people want to do. Do you think so? I can add it. 
I could see a case where you might want to begin a new "alignment group" by leaving a blank line.

```
/* align these 3 */
int a = 5;
/* align these 3 */
int b = 6;
/* align these 3 */
int c = 7;

/* align these 2 which are longer */
int d           = 5
/* align these 2 which are longer */
int oneTwoThree = 123;
```


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