13 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H 14 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H 21 #include "clang/Index/IndexSymbol.h" 22 #include "llvm/ADT/Optional.h" 23 #include "llvm/Support/raw_ostream.h" 66 llvm::Optional<std::string>
Type;
68 llvm::Optional<std::string>
Name;
99 llvm::Optional<std::string>
Type;
137 std::vector<const CXXRecordDecl *>
typeParents(
const CXXRecordDecl *CXXRD);
152 SourceLocation SourceLocationBeg);
161 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H llvm::Optional< QualType > getDeducedType(ParsedAST &AST, SourceLocation SourceLocationBeg)
Retrieves the deduced type at a given location (auto, decltype).
Contains detailed information about a Symbol.
void resolveTypeHierarchy(TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index)
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
llvm::Optional< std::string > Name
None for unnamed parameters.
llvm::Optional< Location > Definition
llvm::StringRef PathRef
A typedef to represent a ref to file path.
llvm::Optional< std::string > Type
Pretty-printed variable type.
llvm::Optional< std::vector< Param > > Parameters
Set for functions, lambdas and macros with parameters.
Represents parameters of a function, a template or a macro.
std::string Definition
Source code containing the definition of the symbol.
llvm::Optional< std::string > Type
The pretty-printed parameter type, e.g.
std::vector< SymbolDetails > getSymbolInfo(ParsedAST &AST, Position Pos)
Get info about symbols at Pos.
std::string Name
Name of the symbol, does not contain any "::".
llvm::Optional< HoverInfo > getHover(ParsedAST &AST, Position Pos, format::FormatStyle Style, const SymbolIndex *Index)
Get the hover information when hovering at Pos.
bool operator==(const Ref &L, const Ref &R)
llvm::Optional< Range > SymRange
llvm::Optional< std::string > Default
None if no default is provided.
Location PreferredDeclaration
std::vector< DocumentHighlight > findDocumentHighlights(ParsedAST &AST, Position Pos)
Returns highlights for all usages of a symbol at Pos.
std::string LocalScope
Remaining named contexts in symbol's qualified name, empty string means symbol is not local...
llvm::Optional< std::string > NamespaceScope
For a variable named Bar, declared in clang::clangd::Foo::getFoo the following fields will hold: ...
Stores and provides access to parsed AST.
llvm::Optional< std::vector< Param > > TemplateParameters
Set for all templates(function, class, variable).
std::vector< Location > findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index)
Returns reference locations of the symbol at a specified Pos.
llvm::Optional< std::string > ReturnType
Set for functions and lambadas.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
const CXXRecordDecl * findRecordTypeAt(ParsedAST &AST, Position Pos)
Find the record type references at Pos.
llvm::Optional< std::string > Value
Contains the evaluated value of the symbol if available.
llvm::Optional< TypeHierarchyItem > getTypeHierarchy(ParsedAST &AST, Position Pos, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index, PathRef TUPath)
Get type hierarchy information at Pos.
std::vector< LocatedSymbol > locateSymbolAt(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Get definition of symbol at a specified Pos.
bool hasDeducedType(ParsedAST &AST, SourceLocation SourceLocationBeg)
Retrieves the deduced type at a given location (auto, decltype).
SymbolKind Kind
Scope containing the symbol.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
std::string Documentation
std::vector< const CXXRecordDecl * > typeParents(const CXXRecordDecl *CXXRD)
Given a record type declaration, find its base (parent) types.
const SymbolIndex * Index
static cl::opt< std::string > FormatStyle("format-style", cl::desc(R"(
Style for formatting code around applied fixes:
- 'none' (default) turns off formatting
- 'file' (literally 'file', not a placeholder)
uses .clang-format file in the closest parent
directory
- '{ <json> }' specifies options inline, e.g.
-format-style='{BasedOnStyle: llvm, IndentWidth: 8}'
- 'llvm', 'google', 'webkit', 'mozilla'
See clang-format documentation for the up-to-date
information about formatting styles and options.
This option overrides the 'FormatStyle` option in
.clang-tidy file, if any.
)"), cl::init("none"), cl::cat(ClangTidyCategory))