[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 01:36:52 PDT 2024


================
@@ -855,7 +859,8 @@ bool BreakableBlockComment::mayReflow(
   StringRef IndentContent = Content[LineIndex];
   if (Lines[LineIndex].ltrim(Blanks).starts_with("*"))
     IndentContent = Lines[LineIndex].ltrim(Blanks).substr(1);
-  return LineIndex > 0 && !CommentPragmasRegex.match(IndentContent) &&
+  return LineIndex > 0 && Style.ReflowComments == FormatStyle::RCS_Always &&
----------------
owenca wrote:

```suggestion
  return LineIndex > 0 && AlwaysReflow &&
```

https://github.com/llvm/llvm-project/pull/96804


More information about the cfe-commits mailing list