[PATCH] D156322: Outputs parameter comments using clang-doc and markdown generator

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 11:28:25 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG29b1af7396b0: Outputs parameter comments using clang-doc and markdown generator (authored by BotellaA, committed by aaron.ballman).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156322/new/

https://reviews.llvm.org/D156322

Files:
  clang-tools-extra/clang-doc/MDGenerator.cpp
  clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp


Index: clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp
+++ clang-tools-extra/unittests/clang-doc/MDGeneratorTest.cpp
@@ -347,9 +347,9 @@
 
  The description continues.
 
-**I** [out]
+**I** [out] is a parameter.
 
-**J**
+**J** is a parameter.
 
 **return**void
 
Index: clang-tools-extra/clang-doc/MDGenerator.cpp
===================================================================
--- clang-tools-extra/clang-doc/MDGenerator.cpp
+++ clang-tools-extra/clang-doc/MDGenerator.cpp
@@ -82,10 +82,14 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156322.545748.patch
Type: text/x-patch
Size: 1482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230731/74103328/attachment.bin>


More information about the cfe-commits mailing list