sun::lsp::DiagnosticsCache
class · Source (opens in a new tab)
class sun::lsp::DiagnosticsCacheStores analysis results so unchanged documents can reuse diagnostics.
Public Functions
clear
public · function · Source (opens in a new tab)
void sun::lsp::DiagnosticsCache::clear()Removes all cached document diagnostics.
computeHash
public · function · static · Source (opens in a new tab)
static std::string sun::lsp::DiagnosticsCache::computeHash(const std::string &content)Computes the content key used to reuse document diagnostics.
get
public · function · Source (opens in a new tab)
const llvm::json::Array & sun::lsp::DiagnosticsCache::get(const std::string &hash) constReturns cached diagnostics for a document content hash when available.
has
public · function · Source (opens in a new tab)
bool sun::lsp::DiagnosticsCache::has(const std::string &hash) constReports whether diagnostics have been cached for the supplied content hash.
invalidate
public · function · Source (opens in a new tab)
void sun::lsp::DiagnosticsCache::invalidate(const std::string &hash)Removes diagnostics associated with an outdated content hash.
put
public · function · Source (opens in a new tab)
void sun::lsp::DiagnosticsCache::put(const std::string &hash, llvm::json::Array diagnostics)Caches diagnostics under the document content hash.
size
public · function · Source (opens in a new tab)
size_t sun::lsp::DiagnosticsCache::size() constReturns the number of stored entries.
Private Fields
cache_
private · variable · Source (opens in a new tab)
std::unordered_map<std::string, llvm::json::Array> sun::lsp::DiagnosticsCache::cache_No documentation comment.
maxEntries_
private · variable · static · Source (opens in a new tab)
size_t sun::lsp::DiagnosticsCache::maxEntries_ = 100No documentation comment.