clang-tools 22.0.0git
|
In-memory Dex trigram-based index implementation. More...
#include <Dex.h>
Public Member Functions | |
template<typename SymbolRange, typename RefsRange, typename RelationsRange> | |
Dex (SymbolRange &&Symbols, RefsRange &&Refs, RelationsRange &&Relations, bool SupportContainedRefs) | |
template<typename SymbolRange, typename RefsRange, typename RelationsRange, typename Payload> | |
Dex (SymbolRange &&Symbols, RefsRange &&Refs, RelationsRange &&Relations, Payload &&BackingData, size_t BackingDataSize, bool SupportContainedRefs) | |
template<typename SymbolRange, typename RefsRange, typename RelationsRange, typename FileRange, typename Payload> | |
Dex (SymbolRange &&Symbols, RefsRange &&Refs, RelationsRange &&Relations, FileRange &&Files, IndexContents IdxContents, Payload &&BackingData, size_t BackingDataSize, bool SupportContainedRefs) | |
bool | fuzzyFind (const FuzzyFindRequest &Req, llvm::function_ref< void(const Symbol &)> Callback) const override |
Constructs iterators over tokens extracted from the query and exhausts it while applying Callback to each symbol in the order of decreasing quality of the matched symbols. | |
void | lookup (const LookupRequest &Req, llvm::function_ref< void(const Symbol &)> Callback) const override |
Looks up symbols with any of the given symbol IDs and applies Callback on each matched symbol. | |
bool | refs (const RefsRequest &Req, llvm::function_ref< void(const Ref &)> Callback) const override |
Finds all occurrences (e.g. | |
bool | containedRefs (const ContainedRefsRequest &Req, llvm::function_ref< void(const ContainedRefsResult &)> Callback) const override |
Find all symbols that are referenced by a symbol and apply Callback on each result. | |
void | relations (const RelationsRequest &Req, llvm::function_ref< void(const SymbolID &, const Symbol &)> Callback) const override |
llvm::unique_function< IndexContents(llvm::StringRef) const > | indexedFiles () const override |
size_t | estimateMemoryUsage () const override |
Returns estimated size of index (in bytes). | |
Public Member Functions inherited from clang::clangd::SymbolIndex | |
virtual | ~SymbolIndex ()=default |
virtual void | relations (const RelationsRequest &Req, llvm::function_ref< void(const SymbolID &Subject, const Symbol &Object)> Callback) const =0 |
Finds all relations (S, P, O) stored in the index such that S is among Req.Subjects and P is Req.Predicate, and invokes Callback for (S, O) in each. |
Static Public Member Functions | |
static std::unique_ptr< SymbolIndex > | build (SymbolSlab, RefSlab, RelationSlab, bool SupportContainedRefs) |
Builds an index from slabs. The index takes ownership of the slab. |
Additional Inherited Members | |
Public Types inherited from clang::clangd::SymbolIndex | |
using | IndexedFiles |
Returns function which checks if the specified file was used to build this index or not. |
|
inline |
|
inline |
|
inline |
|
static |
Builds an index from slabs. The index takes ownership of the slab.
Definition at line 35 of file Dex.cpp.
Referenced by clang::clangd::loadIndex().
|
overridevirtual |
Find all symbols that are referenced by a symbol and apply Callback
on each result.
Results should be returned in arbitrary order. The returned result must be deep-copied if it's used outside Callback.
Returns true if there will be more results (limited by Req.Limit);
Implements clang::clangd::SymbolIndex.
Definition at line 346 of file Dex.cpp.
References clang::clangd::ContainedRefsRequest::ID, and clang::clangd::ContainedRefsRequest::Limit.
|
overridevirtual |
Returns estimated size of index (in bytes).
Implements clang::clangd::SymbolIndex.
|
overridevirtual |
Constructs iterators over tokens extracted from the query and exhausts it while applying Callback to each symbol in the order of decreasing quality of the matched symbols.
Implements clang::clangd::SymbolIndex.
Definition at line 226 of file Dex.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, clang::clangd::dex::consume(), clang::clangd::dex::generateQueryTrigrams(), clang::clangd::FuzzyFindRequest::Limit, clang::clangd::FuzzyMatcher::match(), clang::clangd::Symbol::Name, clang::clangd::FuzzyFindRequest::PreferredTypes, clang::clangd::FuzzyFindRequest::ProximityPaths, clang::clangd::FuzzyFindRequest::Query, clang::clangd::FuzzyFindRequest::RestrictForCodeCompletion, clang::clangd::dex::Token::Scope, clang::clangd::FuzzyFindRequest::Scopes, SPAN_ATTACH, and clang::clangd::vlog().
|
overridevirtual |
Implements clang::clangd::SymbolIndex.
Definition at line 383 of file Dex.cpp.
References clang::clangd::None.
|
overridevirtual |
Looks up symbols with any of the given symbol IDs and applies Callback
on each matched symbol.
The returned symbol must be deep-copied if it's used outside Callback.
Implements clang::clangd::SymbolIndex.
Definition at line 305 of file Dex.cpp.
References clang::clangd::LookupRequest::IDs.
Referenced by relations().
|
overridevirtual |
Finds all occurrences (e.g.
references, declarations, definitions) of symbols and applies Callback
on each result.
Results should be returned in arbitrary order. The returned result must be deep-copied if it's used outside Callback. FIXME: there's no indication which result references which symbol.
Returns true if there will be more results (limited by Req.Limit);
Implements clang::clangd::SymbolIndex.
Definition at line 315 of file Dex.cpp.
References clang::clangd::RefsRequest::Filter, clang::clangd::RefsRequest::IDs, clang::clangd::Ref::Kind, and clang::clangd::RefsRequest::Limit.
|
override |
Definition at line 361 of file Dex.cpp.
References clang::clangd::LookupRequest::IDs, clang::clangd::RelationsRequest::Limit, lookup(), clang::clangd::Object, clang::clangd::RelationsRequest::Predicate, and clang::clangd::RelationsRequest::Subjects.