<div dir="ltr">Can I suggest you submit the patch, so we can discuss it in Phabricator, you can put me down as a reviewer<div><br></div><div><a href="https://llvm.org/docs/Contributing.html">https://llvm.org/docs/Contributing.html</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 1, 2021 at 4:07 PM Lukas Barth via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Paul C. Anagnostopoulos via llvm-dev writes:<br>
> How would the formatter know whether the declarations following the<br>
> comment are a continuation of the preceding series of declarations?<br>
<br>
If "across comments" is set, it would always assume that declarations<br>
following a comment are a continuation of the previous ones. Only a line<br>
containing anything but a declaration or a comment would break alignment.<br>
<br>
One could further control this by distinguishing between block and line<br>
comments. So for example:<br>
<br>
int bar = 1;<br>
// int baz = 2;<br>
int longfoo = 3;<br>
<br>
would be aligned to<br>
<br>
int bar     = 1;<br>
// int baz = 2;<br>
int longfoo = 3;<br>
<br>
But<br>
<br>
int bar = 1;<br>
/* This comment is meant to break alignment */<br>
int longfoo = 3;<br>
<br>
would stay as-is.<br>
<br>
Would you prefer this behavior? I can see its appeal - it gets rid of<br>
all the "superfluous change" when commenting-out an assignment in the<br>
middle of a block, without lobbing together blocks of alignment you want<br>
separated. However, this would make configuration more complicated. For<br>
full flexibility, the enum would then need to have the members:<br>
<br>
  - `<Something>_None` (the old `false`)<br>
  - `<Something>_Consecutive` (the old `true`)<br>
  - `<Something>_AcrossComments`<br>
  - `<Something>_AcrossBlockComments`<br>
  - `<Something>_AcrossLineComments`<br>
  - `<Something>_AcrossEmptyLines`<br>
  - `<Something>_AcrossEmptyLinesAndComments`<br>
  - `<Something>_AcrossEmptyLinesAndBlockComments`<br>
  - `<Something>_AcrossEmptyLinesAndLineComments`<br>
<br>
Regards,<br>
Lukas<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>