[clang] [clang-tools-extra] [llvm] [clangd] introduce doxygen parser (PR #150790)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 07:06:21 PDT 2025


================
@@ -100,7 +101,19 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
     // the comments for namespaces.
     return "";
   }
-  const RawComment *RC = getCompletionComment(Ctx, &Decl);
+
+  const RawComment *RC = nullptr;
+  const Config &Cfg = Config::current();
+
+  if (Cfg.Documentation.CommentFormat == Config::CommentFormatPolicy::Doxygen &&
+      isa<ParmVarDecl>(Decl)) {
+    // Parameters are documented in the function comment.
----------------
tcottin wrote:

Yes, you are right.
I fixed it by parsing the FullComment from the RawComment we get.
I extended the `SymbolDocCommentVisitor` to support parsed FullComments and added a function to extract parameter paragraphs as text from the FullComment.
With that only the string documenting the parameter is extracted now.

https://github.com/llvm/llvm-project/pull/150790


More information about the llvm-commits mailing list