pub struct DocumentState {
pub uri: String,
pub version: i32,
pub content: String,
pub language_id: String,
pub diagnostics: Vec<Diagnostic>,
}
Expand description
Document state tracking.
Fields§
§uri: String
§version: i32
§content: String
§language_id: String
§diagnostics: Vec<Diagnostic>
Implementations§
Source§impl DocumentState
impl DocumentState
Sourcepub fn new<U, C, L>(uri: U, version: i32, content: C, language_id: L) -> Self
pub fn new<U, C, L>(uri: U, version: i32, content: C, language_id: L) -> Self
Create a new document state.
Sourcepub fn update_content<C: Into<String>>(&mut self, content: C)
pub fn update_content<C: Into<String>>(&mut self, content: C)
Update the document content.
Sourcepub fn update_diagnostics(&mut self, diagnostics: Vec<Diagnostic>)
pub fn update_diagnostics(&mut self, diagnostics: Vec<Diagnostic>)
Update diagnostics for the document.
Sourcepub fn get_text_range(&self, range: &Range) -> Result<String>
pub fn get_text_range(&self, range: &Range) -> Result<String>
Get the document text in a specific range.
Trait Implementations§
Source§impl Clone for DocumentState
impl Clone for DocumentState
Source§fn clone(&self) -> DocumentState
fn clone(&self) -> DocumentState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for DocumentState
impl !RefUnwindSafe for DocumentState
impl Send for DocumentState
impl Sync for DocumentState
impl Unpin for DocumentState
impl UnwindSafe for DocumentState
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