9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_HOVER_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_HOVER_H
15#include "clang/Index/IndexSymbol.h"
38 std::optional<std::string>
AKA;
49 std::optional<PrintedType>
Type;
51 std::optional<std::string>
Name;
75 index::SymbolKind
Kind = index::SymbolKind::Unknown;
85 std::optional<PrintedType>
Type;
93 std::optional<std::string>
Value;
95 std::optional<uint64_t>
Size;
127 return std::tie(LHS.
Type, LHS.
AKA) == std::tie(RHS.
Type, RHS.
AKA);
140llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
141 const HoverInfo::PrintedType &);
142llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
const HoverInfo::Param &);
151 const format::FormatStyle &Style,
152 const SymbolIndex *Index);
A format-agnostic representation for structured text.
bool operator==(const Inclusion &LHS, const Inclusion &RHS)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
std::optional< HoverInfo > getHover(ParsedAST &AST, Position Pos, const format::FormatStyle &Style, const SymbolIndex *Index)
Get the hover information when hovering at Pos.
void parseDocumentation(llvm::StringRef Input, markup::Document &Output)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Represents parameters of a function, a template or a macro.
std::optional< PrintedType > Type
The printable parameter type, e.g.
std::optional< std::string > Default
std::nullopt if no default is provided.
std::optional< std::string > Name
std::nullopt for unnamed parameters.
Contains pretty-printed type and desugared type.
PrintedType(const char *Type, const char *AKAType)
PrintedType(const char *Type)
std::string Type
Pretty-printed type.
std::optional< std::string > AKA
Desugared type.
Contains detailed information about a Symbol.
std::optional< PrintedType > ReturnType
Set for functions and lambdas.
std::optional< uint64_t > Padding
Contains the padding following a field within the enclosing class.
std::optional< Range > SymRange
std::optional< uint64_t > Offset
Contains the offset of fields within the enclosing class.
std::string Provider
Header providing the symbol (best match). Contains ""<>.
std::optional< PassType > CallPassType
std::optional< std::vector< Param > > Parameters
Set for functions, lambdas and macros with parameters.
const char * DefinitionLanguage
std::string Name
Name of the symbol, does not contain any "::".
std::optional< PrintedType > Type
Printable variable type.
std::optional< std::vector< Param > > TemplateParameters
Set for all templates(function, class, variable).
markup::Document present() const
Produce a user-readable information.
std::optional< uint64_t > Align
Contains the alignment of fields and types where it's interesting.
std::optional< uint64_t > Size
Contains the bit-size of fields and types where it's interesting.
std::vector< std::string > UsedSymbolNames
std::optional< std::string > Value
Contains the evaluated value of the symbol if available.
std::string Definition
Source code containing the definition of the symbol.
std::optional< std::string > NamespaceScope
For a variable named Bar, declared in clang::clangd::Foo::getFoo the following fields will hold:
std::string Documentation
std::string AccessSpecifier
Access specifier for declarations inside class/struct/unions, empty for others.
std::optional< Param > CalleeArgInfo
std::string LocalScope
Remaining named contexts in symbol's qualified name, empty string means symbol is not local.