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

#include <SymbolDocumentation.h>

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

Public Member Functions

 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()

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

Definition at line 34 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 491 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 523 of file SymbolDocumentation.cpp.

◆ hasBriefCommand()

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

Definition at line 88 of file SymbolDocumentation.h.

◆ hasDetailedDoc()

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

Definition at line 92 of file SymbolDocumentation.h.

◆ hasReturnCommand()

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

Definition at line 90 of file SymbolDocumentation.h.

◆ isParameterDocumented()

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

Definition at line 80 of file SymbolDocumentation.h.

◆ isTemplateTypeParmDocumented()

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

Definition at line 84 of file SymbolDocumentation.h.

◆ parameterDocToMarkup()

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

Definition at line 503 of file SymbolDocumentation.cpp.

◆ parameterDocToString()

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

Definition at line 513 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 353 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 497 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 553 of file SymbolDocumentation.cpp.

◆ templateTypeParmDocToMarkup()

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

Definition at line 533 of file SymbolDocumentation.cpp.

◆ templateTypeParmDocToString()

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

Definition at line 543 of file SymbolDocumentation.cpp.

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

◆ visitBlockCommandComment()

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

Definition at line 457 of file SymbolDocumentation.cpp.

◆ visitParagraphComment()

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

Definition at line 118 of file SymbolDocumentation.h.

◆ visitParamCommandComment()

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

Definition at line 125 of file SymbolDocumentation.h.

◆ visitTParamCommandComment()

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

Definition at line 129 of file SymbolDocumentation.h.


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