13#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H
14#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H
21#include "clang/AST/ASTTypeTraits.h"
22#include "llvm/ADT/StringRef.h"
23#include "llvm/Support/raw_ostream.h"
66 llvm::StringRef MainFilePath,
67 ASTNodeKind NodeKind);
73 const syntax::TokenBuffer &TB);
97llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
117 bool AddContext =
false);
127std::vector<const CXXRecordDecl *>
typeParents(
const CXXRecordDecl *CXXRD);
136std::optional<std::vector<TypeHierarchyItem>>
137superTypes(
const TypeHierarchyItem &Item,
const SymbolIndex *Index);
139std::vector<TypeHierarchyItem>
subTypes(
const TypeHierarchyItem &Item,
140 const SymbolIndex *Index);
144 const SymbolIndex *Index);
147std::vector<CallHierarchyItem>
150std::vector<CallHierarchyIncomingCall>
151incomingCalls(
const CallHierarchyItem &Item,
const SymbolIndex *Index);
155 const FunctionDecl *FD);
Stores and provides access to parsed AST.
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
std::vector< TypeHierarchyItem > subTypes(const TypeHierarchyItem &Item, const SymbolIndex *Index)
Returns direct children of a TypeHierarchyItem.
std::optional< std::vector< TypeHierarchyItem > > superTypes(const TypeHierarchyItem &Item, const SymbolIndex *Index)
Returns direct parents of a TypeHierarchyItem using SymbolIDs stored inside the item.
std::vector< CallHierarchyIncomingCall > incomingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index)
std::vector< DocumentHighlight > findDocumentHighlights(ParsedAST &AST, Position Pos)
Returns highlights for all usages of a symbol at Pos.
std::vector< LocatedSymbol > locateSymbolTextually(const SpelledWord &Word, ParsedAST &AST, const SymbolIndex *Index, llvm::StringRef MainFilePath, ASTNodeKind NodeKind)
std::vector< DocumentLink > getDocumentLinks(ParsedAST &AST)
Get all document links.
std::vector< SymbolDetails > getSymbolInfo(ParsedAST &AST, Position Pos)
Get info about symbols at Pos.
std::vector< LocatedSymbol > findType(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Returns symbols for types referenced at Pos.
std::vector< TypeHierarchyItem > getTypeHierarchy(ParsedAST &AST, Position Pos, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index, PathRef TUPath)
Get type hierarchy information at Pos.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index, bool AddContext)
Returns references of the symbol at a specified Pos.
std::vector< LocatedSymbol > locateSymbolAt(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Get definition of symbol at a specified Pos.
const syntax::Token * findNearbyIdentifier(const SpelledWord &Word, const syntax::TokenBuffer &TB)
std::vector< LocatedSymbol > findImplementations(ParsedAST &AST, Position Pos, const SymbolIndex *Index)
Returns implementations at a specified Pos:
void resolveTypeHierarchy(TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index)
llvm::DenseSet< const Decl * > getNonLocalDeclRefs(ParsedAST &AST, const FunctionDecl *FD)
Returns all decls that are referenced in the FD except local symbols.
llvm::StringRef PathRef
A typedef to represent a ref to file path.
std::vector< const CXXRecordDecl * > findRecordTypeAt(ParsedAST &AST, Position Pos)
Find the record types referenced at Pos.
std::vector< CallHierarchyItem > prepareCallHierarchy(ParsedAST &AST, Position Pos, PathRef TUPath)
Get call hierarchy information at Pos.
std::vector< const CXXRecordDecl * > typeParents(const CXXRecordDecl *CXXRD)
Given a record type declaration, find its base (parent) types.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Location PreferredDeclaration
std::optional< Location > Definition
Extends Locations returned by textDocument/references with extra info.
std::vector< Reference > References