pub struct NotificationCache { /* private fields */ }Expand description
Cache for LSP server notifications.
Implementations§
Source§impl NotificationCache
impl NotificationCache
Sourcepub fn store_diagnostics(
&mut self,
uri: &Uri,
version: Option<i32>,
diagnostics: Vec<LspDiagnostic>,
)
pub fn store_diagnostics( &mut self, uri: &Uri, version: Option<i32>, diagnostics: Vec<LspDiagnostic>, )
Store diagnostics for a document.
If diagnostics already exist for the URI, they are replaced.
Sourcepub fn store_log(&mut self, level: LogLevel, message: String)
pub fn store_log(&mut self, level: LogLevel, message: String)
Store a log entry.
Maintains a maximum of MAX_LOG_ENTRIES entries, removing oldest when full.
Sourcepub fn store_message(&mut self, message_type: MessageType, message: String)
pub fn store_message(&mut self, message_type: MessageType, message: String)
Store a server message.
Maintains a maximum of MAX_SERVER_MESSAGES entries, removing oldest when full.
Sourcepub fn get_diagnostics(&self, uri: &str) -> Option<&DiagnosticInfo>
pub fn get_diagnostics(&self, uri: &str) -> Option<&DiagnosticInfo>
Get diagnostics for a document URI.
Sourcepub const fn get_messages(&self) -> &VecDeque<ServerMessage>
pub const fn get_messages(&self) -> &VecDeque<ServerMessage>
Get all stored server messages.
Sourcepub fn clear_diagnostics(&mut self, uri: &str) -> Option<DiagnosticInfo>
pub fn clear_diagnostics(&mut self, uri: &str) -> Option<DiagnosticInfo>
Clear diagnostics for a specific document URI.
Returns the cleared diagnostics if they existed.
Sourcepub fn clear_all_diagnostics(&mut self)
pub fn clear_all_diagnostics(&mut self)
Clear all diagnostics.
Sourcepub fn clear_logs(&mut self)
pub fn clear_logs(&mut self)
Clear all logs.
Sourcepub fn clear_messages(&mut self)
pub fn clear_messages(&mut self)
Clear all messages.
Sourcepub fn diagnostics_count(&self) -> usize
pub fn diagnostics_count(&self) -> usize
Get the number of documents with stored diagnostics.
Sourcepub fn logs_count(&self) -> usize
pub fn logs_count(&self) -> usize
Get the number of stored log entries.
Sourcepub fn messages_count(&self) -> usize
pub fn messages_count(&self) -> usize
Get the number of stored server messages.
Trait Implementations§
Source§impl Debug for NotificationCache
impl Debug for NotificationCache
Auto Trait Implementations§
impl Freeze for NotificationCache
impl !RefUnwindSafe for NotificationCache
impl Send for NotificationCache
impl Sync for NotificationCache
impl Unpin for NotificationCache
impl UnwindSafe for NotificationCache
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