clang-tools 19.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
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

markup::Document present () const
 Produce a user-readable information.
 

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

markup::Document clang::clangd::HoverInfo::present ( ) 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 82 of file Hover.h.

Referenced by present().

◆ Align

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

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

Definition at line 101 of file Hover.h.

Referenced by present().

◆ CalleeArgInfo

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

Definition at line 104 of file Hover.h.

Referenced by present().

◆ CallPassType

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

Definition at line 115 of file Hover.h.

Referenced by present().

◆ Definition

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

Source code containing the definition of the symbol.

Definition at line 78 of file Hover.h.

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

◆ DefinitionLanguage

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

Definition at line 79 of file Hover.h.

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

◆ Documentation

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

Definition at line 76 of file Hover.h.

Referenced by present().

◆ Kind

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

Definition at line 75 of file Hover.h.

Referenced by 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.

Referenced by present().

◆ 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(), and present().

◆ 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.

Referenced by present().

◆ Offset

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

Contains the offset of fields within the enclosing class.

Definition at line 97 of file Hover.h.

Referenced by present().

◆ Padding

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

Contains the padding following a field within the enclosing class.

Definition at line 99 of file Hover.h.

Referenced by present().

◆ Parameters

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

Set for functions, lambdas and macros with parameters.

Definition at line 89 of file Hover.h.

Referenced by present().

◆ Provider

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

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

Definition at line 73 of file Hover.h.

Referenced by present().

◆ ReturnType

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

Set for functions and lambdas.

Definition at line 87 of file Hover.h.

Referenced by present().

◆ Size

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

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

Definition at line 95 of file Hover.h.

Referenced by present().

◆ 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 91 of file Hover.h.

◆ Type

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

Printable variable type.

Set only for variables.

Definition at line 85 of file Hover.h.

Referenced by present().

◆ UsedSymbolNames

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

Definition at line 119 of file Hover.h.

Referenced by present().

◆ Value

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

Contains the evaluated value of the symbol if available.

Definition at line 93 of file Hover.h.

Referenced by present().


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