clang-tools
9.0.0
|
#include <Background.h>
Public Member Functions | |
BackgroundIndex (Context BackgroundContext, const FileSystemProvider &, const GlobalCompilationDatabase &CDB, BackgroundIndexStorage::Factory IndexStorageFactory, size_t ThreadPoolSize=llvm::heavyweight_hardware_concurrency()) | |
If BuildIndexPeriodMs is greater than 0, the symbol index will only be rebuilt periodically (one per BuildIndexPeriodMs ); otherwise, index is rebuilt for each indexed file. More... | |
~BackgroundIndex () | |
void | enqueue (const std::vector< std::string > &ChangedFiles) |
void | boostRelated (llvm::StringRef Path) |
Boosts priority of indexing related to Path. More... | |
void | stop () |
LLVM_NODISCARD bool | blockUntilIdleForTest (llvm::Optional< double > TimeoutSeconds=10) |
![]() | |
SwapIndex (std::unique_ptr< SymbolIndex > Index=nullptr) | |
void | reset (std::unique_ptr< SymbolIndex >) |
bool | fuzzyFind (const FuzzyFindRequest &, llvm::function_ref< void(const Symbol &)>) const override |
Matches symbols in the index fuzzily and applies Callback on each matched symbol before returning. More... | |
void | lookup (const LookupRequest &, llvm::function_ref< void(const Symbol &)>) const override |
Looks up symbols with any of the given symbol IDs and applies Callback on each matched symbol. More... | |
void | refs (const RefsRequest &, llvm::function_ref< void(const Ref &)>) const override |
Finds all occurrences (e.g. More... | |
void | relations (const RelationsRequest &, llvm::function_ref< void(const SymbolID &, const Symbol &)>) const override |
size_t | estimateMemoryUsage () const override |
Returns estimated size of index (in bytes). More... | |
![]() | |
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. More... | |
Definition at line 115 of file Background.h.
clang::clangd::BackgroundIndex::BackgroundIndex | ( | Context | BackgroundContext, |
const FileSystemProvider & | FSProvider, | ||
const GlobalCompilationDatabase & | CDB, | ||
BackgroundIndexStorage::Factory | IndexStorageFactory, | ||
size_t | ThreadPoolSize = llvm::heavyweight_hardware_concurrency() |
||
) |
If BuildIndexPeriodMs is greater than 0, the symbol index will only be rebuilt periodically (one per BuildIndexPeriodMs
); otherwise, index is rebuilt for each indexed file.
Definition at line 143 of file Background.cpp.
clang::clangd::BackgroundIndex::~BackgroundIndex | ( | ) |
Definition at line 165 of file Background.cpp.
References stop(), and clang::clangd::AsyncTaskRunner::wait().
|
inline |
Definition at line 147 of file Background.h.
References FSProvider, Index, and MainFile.
void clang::clangd::BackgroundIndex::boostRelated | ( | llvm::StringRef | Path | ) |
Boosts priority of indexing related to Path.
Typically used to index TUs when headers are opened.
Definition at line 213 of file Background.cpp.
References clang::clangd::BackgroundQueue::boost(), clang::clangd::File, clang::clangd::filenameWithoutExtension(), Files, Index, MainFile, clang::clangd::IndexFileIn::Refs, Refs, Relations, clang::clangd::IndexFileIn::Sources, clang::clangd::IndexFileIn::Symbols, Symbols, and Type.
|
inline |
Definition at line 130 of file Background.h.
|
inline |
Definition at line 140 of file Background.h.
Referenced by ~BackgroundIndex().