[clang-tools-extra] [clangd] extend and rearrange doxygen hover documentation (PR #152918)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 10 08:36:39 PDT 2025
================
@@ -263,8 +264,76 @@ class BlockCommentToMarkupDocument
StringRef CommentEscapeMarker;
};
-void SymbolDocCommentVisitor::parameterDocToMarkup(StringRef ParamName,
- markup::Paragraph &Out) {
+void SymbolDocCommentVisitor::visitBlockCommandComment(
+ const comments::BlockCommandComment *B) {
+ switch (B->getCommandID()) {
+ case comments::CommandTraits::KCI_brief: {
+ if (!BriefParagraph) {
+ BriefParagraph = B->getParagraph();
+ return;
+ }
+ break;
+ }
+ case comments::CommandTraits::KCI_return:
+ case comments::CommandTraits::KCI_returns:
+ if (!ReturnParagraph) {
+ ReturnParagraph = B->getParagraph();
+ return;
+ }
+ break;
+ case comments::CommandTraits::KCI_retval:
+ RetvalParagraphs.push_back(B->getParagraph());
+ return;
+ case comments::CommandTraits::KCI_warning:
+ WarningParagraphs.push_back(B->getParagraph());
+ return;
+ case comments::CommandTraits::KCI_note:
+ NoteParagraphs.push_back(B->getParagraph());
+ return;
+ default:
+ break;
+ }
+
+ // For all other commands, we store them in the UnhandledCommands map.
+ // This allows us to keep the order of the comments.
+ UnhandledCommands[CommentPartIndex] = B;
+ CommentPartIndex++;
+}
+
+void SymbolDocCommentVisitor::paragraphsToMarkup(
+ markup::Document &Out,
+ const llvm::SmallVector<const comments::ParagraphComment *> &Paragraphs)
----------------
zwuis wrote:
We can use `const llvm::SmallVectorImpl<...> &` as parameter type because we don't care the number of inlined elements here.
https://github.com/llvm/llvm-project/pull/152918
More information about the cfe-commits
mailing list