clang-tools
7.0.0
|
This implements an index for a (relatively small) set of symbols that can be easily managed in memory. More...
#include <MemIndex.h>
Public Member Functions | |
void | build (std::shared_ptr< std::vector< const Symbol *>> Symbols) |
(Re-)Build index for Symbols . More... | |
bool | fuzzyFind (const FuzzyFindRequest &Req, llvm::function_ref< void(const Symbol &)> Callback) const override |
Matches symbols in the index fuzzily and applies Callback on each matched symbol before returning. More... | |
virtual 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. More... | |
![]() | |
virtual | ~SymbolIndex ()=default |
Static Public Member Functions | |
static std::unique_ptr< SymbolIndex > | build (SymbolSlab Slab) |
Build index from a symbol slab. More... | |
This implements an index for a (relatively small) set of symbols that can be easily managed in memory.
Definition at line 21 of file MemIndex.h.
void clang::clangd::MemIndex::build | ( | std::shared_ptr< std::vector< const Symbol *>> | Symbols | ) |
(Re-)Build index for Symbols
.
All symbol pointers must remain accessible as long as Symbols
is kept alive.
Definition at line 18 of file MemIndex.cpp.
|
static |
Build index from a symbol slab.
Definition at line 74 of file MemIndex.cpp.
|
overridevirtual |
Matches symbols in the index fuzzily and applies Callback
on each matched symbol before returning.
If returned Symbols are used outside Callback, they must be deep-copied!
Returns true if there may be more results (limited by MaxCandidateCount).
Implements clang::clangd::SymbolIndex.
Definition at line 31 of file MemIndex.cpp.
References clang::clangd::Symbol::IsIndexedForCodeCompletion, clang::clangd::FuzzyMatcher::match(), clang::clangd::FuzzyFindRequest::MaxCandidateCount, clang::clangd::Symbol::Name, clang::clangd::quality(), clang::clangd::FuzzyFindRequest::Query, clang::clangd::FuzzyFindRequest::RestrictForCodeCompletion, clang::clangd::Symbol::Scope, and clang::clangd::FuzzyFindRequest::Scopes.
|
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 65 of file MemIndex.cpp.
References clang::clangd::LookupRequest::IDs.