clang-tools  9.0.0
Classes | Public Member Functions | Public Attributes | List of all members
clang::clangd::HoverInfo Struct Reference

Contains detailed information about a Symbol. More...

#include <XRefs.h>

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

Classes

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

Public Member Functions

FormattedString 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
 
SymbolKind Kind
 Scope containing the symbol. More...
 
std::string Documentation
 
std::string Definition
 Source code containing the definition of the symbol. More...
 
llvm::Optional< std::string > Type
 Pretty-printed variable type. More...
 
llvm::Optional< std::string > ReturnType
 Set for functions and lambadas. 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...
 

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 57 of file XRefs.h.

Member Function Documentation

◆ present()

FormattedString clang::clangd::HoverInfo::present ( ) const

Member Data Documentation

◆ Definition

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

Source code containing the definition of the symbol.

Definition at line 95 of file XRefs.h.

◆ Documentation

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

Definition at line 93 of file XRefs.h.

Referenced by clang::clangd::enhanceFromIndex(), and clang::clangd::getHoverContents().

◆ Kind

SymbolKind clang::clangd::HoverInfo::Kind

Scope containing the symbol.

e.g, "global namespace", "function x::Y"

  • None for deduced types, e.g "auto", "decltype" keywords.

Definition at line 92 of file XRefs.h.

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

◆ 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 86 of file XRefs.h.

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

◆ Name

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

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

Definition at line 88 of file XRefs.h.

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

◆ 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 83 of file XRefs.h.

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

◆ Parameters

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

Set for functions, lambdas and macros with parameters.

Definition at line 103 of file XRefs.h.

◆ ReturnType

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

Set for functions and lambadas.

Definition at line 101 of file XRefs.h.

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

◆ SymRange

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

Definition at line 89 of file XRefs.h.

◆ TemplateParameters

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

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

Definition at line 105 of file XRefs.h.

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

◆ Type

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

Pretty-printed variable type.

Set only for variables.

Definition at line 99 of file XRefs.h.

◆ Value

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

Contains the evaluated value of the symbol if available.

Definition at line 107 of file XRefs.h.


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