clang-tools 22.0.0git
clang::clangd::SymbolDocCommentVisitor Class Reference

#include <SymbolDocumentation.h>

Inheritance diagram for clang::clangd::SymbolDocCommentVisitor:
[legend]

Public Member Functions

 SymbolDocCommentVisitor (comments::FullComment *FC, const CommentOptions &CommentOpts)
 SymbolDocCommentVisitor (llvm::StringRef Documentation, const CommentOptions &CommentOpts)
bool isParameterDocumented (StringRef ParamName) const
bool isTemplateTypeParmDocumented (StringRef ParamName) const
bool hasBriefCommand () const
bool hasReturnCommand () const
bool hasDetailedDoc () const
void detailedDocToMarkup (markup::Document &Out) const
 Converts all unhandled comment commands to a markup document.
void briefToMarkup (markup::Paragraph &Out) const
 Converts the "brief" command(s) to a markup document.
void returnToMarkup (markup::Paragraph &Out) const
 Converts the "return" command(s) to a markup document.
void retvalsToMarkup (markup::Document &Out) const
 Converts the "retval" command(s) to a markup document.
void visitBlockCommandComment (const comments::BlockCommandComment *B)
void templateTypeParmDocToMarkup (StringRef TemplateParamName, markup::Paragraph &Out) const
void templateTypeParmDocToString (StringRef TemplateParamName, llvm::raw_string_ostream &Out) const
void parameterDocToMarkup (StringRef ParamName, markup::Paragraph &Out) const
void parameterDocToString (StringRef ParamName, llvm::raw_string_ostream &Out) const
void visitParagraphComment (const comments::ParagraphComment *P)
void visitParamCommandComment (const comments::ParamCommandComment *P)
void visitTParamCommandComment (const comments::TParamCommandComment *TP)
void preprocessDocumentation (StringRef Doc)
 Preprocesses the raw documentation string to prepare it for doxygen parsing.

Detailed Description

Definition at line 31 of file SymbolDocumentation.h.

Constructor & Destructor Documentation

◆ SymbolDocCommentVisitor() [1/2]

clang::clangd::SymbolDocCommentVisitor::SymbolDocCommentVisitor ( comments::FullComment * FC,
const CommentOptions & CommentOpts )
inline

Definition at line 34 of file SymbolDocumentation.h.

◆ SymbolDocCommentVisitor() [2/2]

clang::clangd::SymbolDocCommentVisitor::SymbolDocCommentVisitor ( llvm::StringRef Documentation,
const CommentOptions & CommentOpts )
inline

Definition at line 45 of file SymbolDocumentation.h.

References preprocessDocumentation().

Member Function Documentation

◆ briefToMarkup()

void clang::clangd::SymbolDocCommentVisitor::briefToMarkup ( markup::Paragraph & Out) const

Converts the "brief" command(s) to a markup document.

Definition at line 489 of file SymbolDocumentation.cpp.

◆ detailedDocToMarkup()

void clang::clangd::SymbolDocCommentVisitor::detailedDocToMarkup ( markup::Document & Out) const

Converts all unhandled comment commands to a markup document.

Definition at line 521 of file SymbolDocumentation.cpp.

◆ hasBriefCommand()

bool clang::clangd::SymbolDocCommentVisitor::hasBriefCommand ( ) const
inline

Definition at line 99 of file SymbolDocumentation.h.

◆ hasDetailedDoc()

bool clang::clangd::SymbolDocCommentVisitor::hasDetailedDoc ( ) const
inline

Definition at line 103 of file SymbolDocumentation.h.

◆ hasReturnCommand()

bool clang::clangd::SymbolDocCommentVisitor::hasReturnCommand ( ) const
inline

Definition at line 101 of file SymbolDocumentation.h.

◆ isParameterDocumented()

bool clang::clangd::SymbolDocCommentVisitor::isParameterDocumented ( StringRef ParamName) const
inline

Definition at line 91 of file SymbolDocumentation.h.

◆ isTemplateTypeParmDocumented()

bool clang::clangd::SymbolDocCommentVisitor::isTemplateTypeParmDocumented ( StringRef ParamName) const
inline

Definition at line 95 of file SymbolDocumentation.h.

◆ parameterDocToMarkup()

void clang::clangd::SymbolDocCommentVisitor::parameterDocToMarkup ( StringRef ParamName,
markup::Paragraph & Out ) const

Definition at line 501 of file SymbolDocumentation.cpp.

◆ parameterDocToString()

void clang::clangd::SymbolDocCommentVisitor::parameterDocToString ( StringRef ParamName,
llvm::raw_string_ostream & Out ) const

Definition at line 511 of file SymbolDocumentation.cpp.

Referenced by clang::clangd::getDeclComment().

◆ preprocessDocumentation()

void clang::clangd::SymbolDocCommentVisitor::preprocessDocumentation ( StringRef Doc)

Preprocesses the raw documentation string to prepare it for doxygen parsing.

This is a workaround to provide better support for markdown in doxygen. Clang's doxygen parser e.g. does not handle markdown code blocks.

The documentation string is preprocessed to replace some markdown constructs with parsable doxygen commands. E.g. markdown code blocks are replaced with doxygen \code{.lang} ... \endcode blocks.

Additionally, potential doxygen commands inside markdown inline code spans are escaped to avoid that doxygen tries to interpret them as commands.

Note
Although this is a workaround, it is very similar to what doxygen itself does for markdown. In doxygen, the first parsing step is also a markdown preprocessing step. See https://www.doxygen.nl/manual/markdown.html

Definition at line 351 of file SymbolDocumentation.cpp.

Referenced by SymbolDocCommentVisitor().

◆ returnToMarkup()

void clang::clangd::SymbolDocCommentVisitor::returnToMarkup ( markup::Paragraph & Out) const

Converts the "return" command(s) to a markup document.

Definition at line 495 of file SymbolDocumentation.cpp.

◆ retvalsToMarkup()

void clang::clangd::SymbolDocCommentVisitor::retvalsToMarkup ( markup::Document & Out) const

Converts the "retval" command(s) to a markup document.

Definition at line 551 of file SymbolDocumentation.cpp.

◆ templateTypeParmDocToMarkup()

void clang::clangd::SymbolDocCommentVisitor::templateTypeParmDocToMarkup ( StringRef TemplateParamName,
markup::Paragraph & Out ) const

Definition at line 531 of file SymbolDocumentation.cpp.

◆ templateTypeParmDocToString()

void clang::clangd::SymbolDocCommentVisitor::templateTypeParmDocToString ( StringRef TemplateParamName,
llvm::raw_string_ostream & Out ) const

Definition at line 541 of file SymbolDocumentation.cpp.

Referenced by clang::clangd::getDeclComment().

◆ visitBlockCommandComment()

void clang::clangd::SymbolDocCommentVisitor::visitBlockCommandComment ( const comments::BlockCommandComment * B)

Definition at line 455 of file SymbolDocumentation.cpp.

◆ visitParagraphComment()

void clang::clangd::SymbolDocCommentVisitor::visitParagraphComment ( const comments::ParagraphComment * P)
inline

Definition at line 129 of file SymbolDocumentation.h.

◆ visitParamCommandComment()

void clang::clangd::SymbolDocCommentVisitor::visitParamCommandComment ( const comments::ParamCommandComment * P)
inline

Definition at line 136 of file SymbolDocumentation.h.

◆ visitTParamCommandComment()

void clang::clangd::SymbolDocCommentVisitor::visitTParamCommandComment ( const comments::TParamCommandComment * TP)
inline

Definition at line 140 of file SymbolDocumentation.h.


The documentation for this class was generated from the following files: