[PATCH] Preserve hanging indent when breaking line comments.

Manuel Klimek klimek at google.com
Mon Mar 10 01:03:39 PDT 2014



================
Comment at: lib/Format/BreakableToken.cpp:190
@@ +189,3 @@
+    "///                                                        ",
+    "//                                                         "
+  };
----------------
Is there a reason we only want to allow the number of spaces in this string? Otherwise, I'd find an implementation that just has /// and // in the KnownPrefixes and then says || Comment[PrefixLength] == ' ' a lot less unexpected.

================
Comment at: lib/Format/BreakableToken.cpp:187
@@ -186,2 +186,3 @@
 
 static StringRef getLineCommentPrefix(StringRef Comment) {
+  static const char *const KnownPrefixes[] = {
----------------
This is unrelated, but perhaps getLineCommentIndentPrefix or something would be clearer (I somehow expected us to try to find a more generic prefix).


http://llvm-reviews.chandlerc.com/D2988



More information about the cfe-commits mailing list