clang-tools  14.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>

Collaboration diagram for clang::clangd::HoverInfo:
Collaboration graph
[legend]

Classes

struct  Param
 Represents parameters of a function, a template or a macro. More...
 
struct  PassType
 

Public Member Functions

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

Public Attributes

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

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 24 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 64 of file Hover.h.

◆ CalleeArgInfo

llvm::Optional<Param> clang::clangd::HoverInfo::CalleeArgInfo

Definition at line 84 of file Hover.h.

◆ CallPassType

llvm::Optional<PassType> clang::clangd::HoverInfo::CallPassType

Definition at line 95 of file Hover.h.

◆ Definition

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

Source code containing the definition of the symbol.

Definition at line 60 of file Hover.h.

◆ DefinitionLanguage

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

Definition at line 61 of file Hover.h.

◆ Documentation

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

Definition at line 58 of file Hover.h.

◆ Kind

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

Definition at line 57 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 53 of file Hover.h.

◆ Name

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

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

Definition at line 55 of file Hover.h.

Referenced by present().

◆ NamespaceScope

llvm::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 50 of file Hover.h.

◆ Offset

llvm::Optional<uint64_t> clang::clangd::HoverInfo::Offset

Contains the offset of fields within the enclosing class.

Definition at line 79 of file Hover.h.

◆ Padding

llvm::Optional<uint64_t> clang::clangd::HoverInfo::Padding

Contains the padding following a field within the enclosing class.

Definition at line 81 of file Hover.h.

◆ Parameters

llvm::Optional<std::vector<Param> > clang::clangd::HoverInfo::Parameters

Set for functions, lambdas and macros with parameters.

Definition at line 71 of file Hover.h.

Referenced by present().

◆ ReturnType

llvm::Optional<std::string> clang::clangd::HoverInfo::ReturnType

Set for functions and lambdas.

Definition at line 69 of file Hover.h.

Referenced by present().

◆ Size

llvm::Optional<uint64_t> clang::clangd::HoverInfo::Size

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

Definition at line 77 of file Hover.h.

◆ SymRange

llvm::Optional<Range> clang::clangd::HoverInfo::SymRange

Definition at line 56 of file Hover.h.

◆ TemplateParameters

llvm::Optional<std::vector<Param> > clang::clangd::HoverInfo::TemplateParameters

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

Definition at line 73 of file Hover.h.

◆ Type

llvm::Optional<std::string> clang::clangd::HoverInfo::Type

Pretty-printed variable type.

Set only for variables.

Definition at line 67 of file Hover.h.

◆ Value

llvm::Optional<std::string> clang::clangd::HoverInfo::Value

Contains the evaluated value of the symbol if available.

Definition at line 75 of file Hover.h.


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