Summary:
Doxygen supports putting documentation blocks after member, by adding
an additional < marker in the comment block. This patch makes sure
this marker is used in lines which are introduced by breaking the
comment.
int foo; ///< Some very long comment.
becomes:
int foo; ///< Some very long
///< comment.
Contributed by @Typz!
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: djasper, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33282
llvm-svn: 303330
}
static StringRef getLineCommentIndentPrefix(StringRef Comment) {
- static const char *const KnownPrefixes[] = {"///", "//", "//!"};
+ static const char *const KnownPrefixes[] = {
+ "///<", "//!<", "///", "//", "//!"};
StringRef LongestPrefix;
for (StringRef KnownPrefix : KnownPrefixes) {
if (Comment.startswith(KnownPrefix)) {
Prefix[i] = "/// ";
else if (Prefix[i] == "//!")
Prefix[i] = "//! ";
+ else if (Prefix[i] == "///<")
+ Prefix[i] = "///< ";
+ else if (Prefix[i] == "//!<")
+ Prefix[i] = "//!< ";
}
Tokens[i] = LineTok;
format("/* long long long long\n"
" * long */",
getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("///< long long long\n"
+ "///< long long\n",
+ format("///< long long long long\n"
+ "///< long\n",
+ getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("//!< long long long\n"
+ "//!< long long\n",
+ format("//!< long long long long\n"
+ "//!< long\n",
+ getLLVMStyleWithColumns(20)));
// Don't bring leading whitespace up while reflowing.
EXPECT_EQ("/* long long long\n"