clang-tools 10.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 <Hover.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
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< Range > | SymRange
index::SymbolKind | Kind = index::SymbolKind::Unknown
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 24 of file Hover.h.

## Member Function Documentation

## ◆ present()

markup::Document clang::clangd::HoverInfo::present | ( |  | ) | const

Produce a user-readable information.

Definition at line 532 of file Hover.cpp.

References clang::clangd::markup::Document::addBulletList(), clang::clangd::markup::Document::addHeading(), clang::clangd::markup::Document::addParagraph(), clang::clangd::markup::Document::addRuler(), clang::clangd::markup::Paragraph::appendCode(), clang::clangd::markup::Paragraph::appendText(), Kind, Name, Parameters, ReturnType, and clang::clangd::Unknown.

## Member Data Documentation

## ◆ Definition

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

Source code containing the definition of the symbol.

Definition at line 60 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.

## ◆ Parameters

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

Set for functions, lambdas and macros with parameters.

Definition at line 68 of file Hover.h.

Referenced by present().

## ◆ ReturnType

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

Set for functions and lambadas.

Definition at line 66 of file Hover.h.

Referenced by present().

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

## ◆ Type

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

Pretty-printed variable type.

Set only for variables.

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

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

- Hover.h
- Hover.cpp