Skip to content

Commit

Permalink
Outputs parameter comments using clang-doc and markdown generator
Browse files Browse the repository at this point in the history
Current implementation outputs the parameter name when used with @param
(or @tparam) doxygen tag but not the comment itself.

Differential Revision: https://reviews.llvm.org/D156322
  • Loading branch information
BotellaA authored and AaronBallman committed Jul 31, 2023
1 parent 478e0b5 commit 29b1af7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions clang-tools-extra/clang-doc/MDGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ static void writeDescription(const CommentInfo &I, raw_ostream &OS) {
OS << genEmphasis(I.Name) << " " << I.Text;
} else if (I.Kind == "ParamCommandComment") {
std::string Direction = I.Explicit ? (" " + I.Direction).str() : "";
OS << genEmphasis(I.ParamName) << I.Text << Direction << "\n\n";
OS << genEmphasis(I.ParamName) << I.Text << Direction;
for (const auto &Child : I.Children)
writeDescription(*Child, OS);
} else if (I.Kind == "TParamCommandComment") {
std::string Direction = I.Explicit ? (" " + I.Direction).str() : "";
OS << genEmphasis(I.ParamName) << I.Text << Direction << "\n\n";
OS << genEmphasis(I.ParamName) << I.Text << Direction;
for (const auto &Child : I.Children)
writeDescription(*Child, OS);
} else if (I.Kind == "VerbatimBlockComment") {
for (const auto &Child : I.Children)
writeDescription(*Child, OS);
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ TEST(MDGeneratorTest, emitCommentMD) {
The description continues.
**I** [out]
**I** [out] is a parameter.
**J**
**J** is a parameter.
**return**void
Expand Down

0 comments on commit 29b1af7

Please sign in to comment.