clang-tools 20.0.0git
|
A thread-safe container for files opened in a workspace, addressed by filenames. More...
#include <DraftStore.h>
Classes | |
struct | Draft |
Public Member Functions | |
std::optional< Draft > | getDraft (PathRef File) const |
std::vector< Path > | getActiveFiles () const |
std::string | addDraft (PathRef File, llvm::StringRef Version, StringRef Contents) |
Replace contents of the draft for File with Contents . | |
void | removeDraft (PathRef File) |
Remove the draft from the store. | |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | asVFS () const |
A thread-safe container for files opened in a workspace, addressed by filenames.
The contents are owned by the DraftStore. Each time a draft is updated, it is assigned a version. This can be specified by the caller or incremented from the previous version.
Definition at line 28 of file DraftStore.h.
std::string clang::clangd::DraftStore::addDraft | ( | PathRef | File, |
llvm::StringRef | Version, | ||
StringRef | Contents | ||
) |
Replace contents of the draft for File
with Contents
.
If version is empty, one will be automatically assigned. Returns the version.
Definition at line 75 of file DraftStore.cpp.
References clang::clangd::File, and clang::clangd::updateVersion().
Referenced by clang::clangd::ClangdServer::addDocument().
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > clang::clangd::DraftStore::asVFS | ( | ) | const |
Definition at line 117 of file DraftStore.cpp.
References clang::clangd::DraftStore::Draft::Contents.
std::vector< Path > clang::clangd::DraftStore::getActiveFiles | ( | ) | const |
Definition at line 29 of file DraftStore.cpp.
Referenced by clang::clangd::ClangdServer::reparseOpenFilesIfNeeded().
std::optional< DraftStore::Draft > clang::clangd::DraftStore::getDraft | ( | PathRef | File | ) | const |
Definition at line 19 of file DraftStore.cpp.
References clang::clangd::File.
Referenced by clang::clangd::ClangdServer::getDraft(), and clang::clangd::ClangdServer::reparseOpenFilesIfNeeded().
void clang::clangd::DraftStore::removeDraft | ( | PathRef | File | ) |
Remove the draft from the store.
Definition at line 86 of file DraftStore.cpp.
References clang::clangd::File.
Referenced by clang::clangd::ClangdServer::removeDocument().