[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


================
@@ -497,6 +497,16 @@ template <> struct MappingTraits<FormatStyle::RawStringFormat> {
   }
 };
 
+template <> struct ScalarEnumerationTraits<FormatStyle::ReflowCommentsStyle> {
+  static void enumeration(IO &IO, FormatStyle::ReflowCommentsStyle &Value) {
+    IO.enumCase(Value, "Never", FormatStyle::RCS_Never);
+    IO.enumCase(Value, "IndentOnly", FormatStyle::RCS_IndentOnly);
+    IO.enumCase(Value, "Always", FormatStyle::RCS_Always);
----------------
owenca wrote:

```suggestion
    IO.enumCase(Value, "Always", FormatStyle::RCS_Always);
    // For backward compatibility:
```

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


More information about the cfe-commits mailing list