pub struct Document {
pub uri: Uri,
pub version: i32,
pub rope: Rope,
pub cached_symbols: Vec<SymbolInfo>,
pub cached_types: HashMap<String, String>,
}Expand description
A document in the workspace with its content and metadata
Fields§
§uri: UriThe URI of the document
version: i32The version number (from LSP protocol)
rope: RopeThe text content as a Rope for efficient editing
cached_symbols: Vec<SymbolInfo>Cached symbols from last successful parse (for completion fallback)
cached_types: HashMap<String, String>Cached type info from last successful inference (for completion fallback)
Implementations§
Source§impl Document
impl Document
Sourcepub fn update_cached_symbols(&mut self, symbols: Vec<SymbolInfo>)
pub fn update_cached_symbols(&mut self, symbols: Vec<SymbolInfo>)
Update cached symbols from successful parse
Sourcepub fn update_cached_types(&mut self, types: HashMap<String, String>)
pub fn update_cached_types(&mut self, types: HashMap<String, String>)
Update cached type info from successful inference
Sourcepub fn get_cached_symbols(&self) -> &[SymbolInfo]
pub fn get_cached_symbols(&self) -> &[SymbolInfo]
Get cached symbols
Sourcepub fn get_cached_types(&self) -> &HashMap<String, String>
pub fn get_cached_types(&self) -> &HashMap<String, String>
Get cached type info
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get the number of lines
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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