pub struct DocumentStore { /* private fields */ }Expand description
Tracks document state for LSP synchronization.
LSP requires:
- didOpen before didChange (document must be opened first)
- Version numbers must be monotonically increasing
- Full content sent with each change (TextDocumentSyncKind::Full)
Implementations§
Source§impl DocumentStore
impl DocumentStore
pub fn new() -> Self
Sourcepub fn open(&mut self, path: PathBuf) -> i32
pub fn open(&mut self, path: PathBuf) -> i32
Open a new document. Returns the initial version (0).
Sourcepub fn bump_version(&mut self, path: &Path) -> i32
pub fn bump_version(&mut self, path: &Path) -> i32
Bump the version for an already-open document. Returns the new version. Panics if document is not open.
Sourcepub fn open_documents(&self) -> Vec<&PathBuf>
pub fn open_documents(&self) -> Vec<&PathBuf>
Get all open document paths.
Trait Implementations§
Source§impl Debug for DocumentStore
impl Debug for DocumentStore
Source§impl Default for DocumentStore
impl Default for DocumentStore
Source§fn default() -> DocumentStore
fn default() -> DocumentStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DocumentStore
impl RefUnwindSafe for DocumentStore
impl Send for DocumentStore
impl Sync for DocumentStore
impl Unpin for DocumentStore
impl UnsafeUnpin for DocumentStore
impl UnwindSafe for DocumentStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more