MyDeveloperDay updated this revision to Diff 313297. MyDeveloperDay added a comment.
remove //= and //~ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93490/new/ https://reviews.llvm.org/D93490 Files: clang/lib/Format/BreakableToken.cpp clang/unittests/Format/FormatTestComments.cpp Index: clang/unittests/Format/FormatTestComments.cpp =================================================================== --- clang/unittests/Format/FormatTestComments.cpp +++ clang/unittests/Format/FormatTestComments.cpp @@ -702,6 +702,12 @@ " // long 1 2 3 4 5 6\n" "}", getLLVMStyleWithColumns(20))); + + EXPECT_EQ("//: A comment that\n" + "//: doesn't fit on\n" + "//: one line", + format("//: A comment that doesn't fit on one line", + getLLVMStyleWithColumns(20))); } TEST_F(FormatTestComments, PreservesHangingIndentInCxxComments) { Index: clang/lib/Format/BreakableToken.cpp =================================================================== --- clang/lib/Format/BreakableToken.cpp +++ clang/lib/Format/BreakableToken.cpp @@ -41,8 +41,8 @@ static StringRef getLineCommentIndentPrefix(StringRef Comment, const FormatStyle &Style) { - static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", "//", - "//!"}; + static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", + "//", "//!", "//:"}; static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###", "####"}; ArrayRef<const char *> KnownPrefixes(KnownCStylePrefixes);
Index: clang/unittests/Format/FormatTestComments.cpp =================================================================== --- clang/unittests/Format/FormatTestComments.cpp +++ clang/unittests/Format/FormatTestComments.cpp @@ -702,6 +702,12 @@ " // long 1 2 3 4 5 6\n" "}", getLLVMStyleWithColumns(20))); + + EXPECT_EQ("//: A comment that\n" + "//: doesn't fit on\n" + "//: one line", + format("//: A comment that doesn't fit on one line", + getLLVMStyleWithColumns(20))); } TEST_F(FormatTestComments, PreservesHangingIndentInCxxComments) { Index: clang/lib/Format/BreakableToken.cpp =================================================================== --- clang/lib/Format/BreakableToken.cpp +++ clang/lib/Format/BreakableToken.cpp @@ -41,8 +41,8 @@ static StringRef getLineCommentIndentPrefix(StringRef Comment, const FormatStyle &Style) { - static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", "//", - "//!"}; + static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", + "//", "//!", "//:"}; static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###", "####"}; ArrayRef<const char *> KnownPrefixes(KnownCStylePrefixes);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits