clang-tools 22.0.0git
clang::clangd::HoverInfo Struct Reference

Contains detailed information about a Symbol. More...

#include <Hover.h>

Classes

struct  Param
 Represents parameters of a function, a template or a macro. More...
struct  PassType
struct  PrintedType
 Contains pretty-printed type and desugared type. More...

Public Member Functions

std::string present (MarkupKind Kind) const
 Produce a user-readable information based on the specified markup kind.

Public Attributes

std::optional< std::string > NamespaceScope
 For a variable named Bar, declared in clang::clangd::Foo::getFoo the following fields will hold:
std::string LocalScope
 Remaining named contexts in symbol's qualified name, empty string means symbol is not local.
std::string Name
 Name of the symbol, does not contain any "::".
std::string Provider
 Header providing the symbol (best match). Contains ""<>.
std::optional< RangeSymRange
index::SymbolKind Kind = index::SymbolKind::Unknown
std::string Documentation
CommentOptions CommentOpts
std::string Definition
 Source code containing the definition of the symbol.
const char * DefinitionLanguage = "cpp"
std::string AccessSpecifier
 Access specifier for declarations inside class/struct/unions, empty for others.
std::optional< PrintedTypeType
 Printable variable type.
std::optional< PrintedTypeReturnType
 Set for functions and lambdas.
std::optional< std::vector< Param > > Parameters
 Set for functions, lambdas and macros with parameters.
std::optional< std::vector< Param > > TemplateParameters
 Set for all templates(function, class, variable).
std::optional< std::string > Value
 Contains the evaluated value of the symbol if available.
std::optional< uint64_t > Size
 Contains the bit-size of fields and types where it's interesting.
std::optional< uint64_t > Offset
 Contains the offset of fields within the enclosing class.
std::optional< uint64_t > Padding
 Contains the padding following a field within the enclosing class.
std::optional< uint64_t > Align
 Contains the alignment of fields and types where it's interesting.
std::optional< ParamCalleeArgInfo
std::optional< PassTypeCallPassType
std::vector< std::string > UsedSymbolNames

Detailed Description

Contains detailed information about a Symbol.

Especially useful when generating hover responses. It can be rendered as a hover panel, or embedding clients can use the structured information to provide their own UI.

Definition at line 27 of file Hover.h.

Member Function Documentation

◆ present()

std::string clang::clangd::HoverInfo::present ( MarkupKind Kind) const

Member Data Documentation

◆ AccessSpecifier

std::string clang::clangd::HoverInfo::AccessSpecifier

Access specifier for declarations inside class/struct/unions, empty for others.

Definition at line 84 of file Hover.h.

◆ Align

std::optional<uint64_t> clang::clangd::HoverInfo::Align

Contains the alignment of fields and types where it's interesting.

Definition at line 103 of file Hover.h.

◆ CalleeArgInfo

std::optional<Param> clang::clangd::HoverInfo::CalleeArgInfo

Definition at line 106 of file Hover.h.

◆ CallPassType

std::optional<PassType> clang::clangd::HoverInfo::CallPassType

Definition at line 117 of file Hover.h.

◆ CommentOpts

CommentOptions clang::clangd::HoverInfo::CommentOpts

Definition at line 78 of file Hover.h.

◆ Definition

std::string clang::clangd::HoverInfo::Definition

Source code containing the definition of the symbol.

Definition at line 80 of file Hover.h.

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

◆ DefinitionLanguage

const char* clang::clangd::HoverInfo::DefinitionLanguage = "cpp"

Definition at line 81 of file Hover.h.

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

◆ Documentation

std::string clang::clangd::HoverInfo::Documentation

Definition at line 76 of file Hover.h.

◆ Kind

index::SymbolKind clang::clangd::HoverInfo::Kind = index::SymbolKind::Unknown

Definition at line 75 of file Hover.h.

Referenced by clang::clangd::getHover(), and present().

◆ LocalScope

std::string clang::clangd::HoverInfo::LocalScope

Remaining named contexts in symbol's qualified name, empty string means symbol is not local.

Definition at line 69 of file Hover.h.

◆ Name

std::string clang::clangd::HoverInfo::Name

Name of the symbol, does not contain any "::".

Definition at line 71 of file Hover.h.

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

◆ NamespaceScope

std::optional<std::string> clang::clangd::HoverInfo::NamespaceScope

For a variable named Bar, declared in clang::clangd::Foo::getFoo the following fields will hold:

  • NamespaceScope: clang::clangd::
  • LocalScope: Foo::getFoo::
  • Name: Bar Scopes might be None in cases where they don't make sense, e.g. macros and auto/decltype. Contains all of the enclosing namespaces, empty string means global namespace.

Definition at line 66 of file Hover.h.

◆ Offset

std::optional<uint64_t> clang::clangd::HoverInfo::Offset

Contains the offset of fields within the enclosing class.

Definition at line 99 of file Hover.h.

◆ Padding

std::optional<uint64_t> clang::clangd::HoverInfo::Padding

Contains the padding following a field within the enclosing class.

Definition at line 101 of file Hover.h.

◆ Parameters

std::optional<std::vector<Param> > clang::clangd::HoverInfo::Parameters

Set for functions, lambdas and macros with parameters.

Definition at line 91 of file Hover.h.

◆ Provider

std::string clang::clangd::HoverInfo::Provider

Header providing the symbol (best match). Contains ""<>.

Definition at line 73 of file Hover.h.

◆ ReturnType

std::optional<PrintedType> clang::clangd::HoverInfo::ReturnType

Set for functions and lambdas.

Definition at line 89 of file Hover.h.

◆ Size

std::optional<uint64_t> clang::clangd::HoverInfo::Size

Contains the bit-size of fields and types where it's interesting.

Definition at line 97 of file Hover.h.

◆ SymRange

std::optional<Range> clang::clangd::HoverInfo::SymRange

Definition at line 74 of file Hover.h.

◆ TemplateParameters

std::optional<std::vector<Param> > clang::clangd::HoverInfo::TemplateParameters

Set for all templates(function, class, variable).

Definition at line 93 of file Hover.h.

◆ Type

std::optional<PrintedType> clang::clangd::HoverInfo::Type

Printable variable type.

Set only for variables.

Definition at line 87 of file Hover.h.

◆ UsedSymbolNames

std::vector<std::string> clang::clangd::HoverInfo::UsedSymbolNames

Definition at line 121 of file Hover.h.

◆ Value

std::optional<std::string> clang::clangd::HoverInfo::Value

Contains the evaluated value of the symbol if available.

Definition at line 95 of file Hover.h.


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