clang-tools
10.0.0
|
A thread-safe container for files opened in a workspace, addressed by filenames. More...
#include <DraftStore.h>
Public Member Functions | |
llvm::Optional< std::string > | getDraft (PathRef File) const |
std::vector< Path > | getActiveFiles () const |
void | addDraft (PathRef File, StringRef Contents) |
Replace contents of the draft for File with Contents . More... | |
llvm::Expected< std::string > | updateDraft (PathRef File, llvm::ArrayRef< TextDocumentContentChangeEvent > Changes) |
Update the contents of the draft for File based on Changes . More... | |
void | removeDraft (PathRef File) |
Remove the draft from the store. More... | |
A thread-safe container for files opened in a workspace, addressed by filenames.
The contents are owned by the DraftStore. This class supports both whole and incremental updates of the documents.
Definition at line 26 of file DraftStore.h.
void clang::clangd::DraftStore::addDraft | ( | PathRef | File, |
StringRef | Contents | ||
) |
Replace contents of the draft for File
with Contents
.
Definition at line 36 of file DraftStore.cpp.
References Contents, and clang::clangd::File.
std::vector< Path > clang::clangd::DraftStore::getActiveFiles | ( | ) | const |
Definition at line 26 of file DraftStore.cpp.
llvm::Optional< std::string > clang::clangd::DraftStore::getDraft | ( | PathRef | File | ) | const |
Definition at line 16 of file DraftStore.cpp.
References clang::clangd::None.
void clang::clangd::DraftStore::removeDraft | ( | PathRef | File | ) |
Remove the draft from the store.
Definition at line 111 of file DraftStore.cpp.
llvm::Expected< std::string > clang::clangd::DraftStore::updateDraft | ( | PathRef | File, |
llvm::ArrayRef< TextDocumentContentChangeEvent > | Changes | ||
) |
Update the contents of the draft for File
based on Changes
.
If a position in Changes
is invalid (e.g. out-of-range), the draft is not modified.
File
, or an error if the changes couldn't be applied. Definition at line 42 of file DraftStore.cpp.
References Contents, and clang::clangd::File.