pub struct DiagnosticsStore { /* private fields */ }Expand description
Stores diagnostics from all LSP servers.
Uses replacement semantics: each publishDiagnostics notification replaces all diagnostics for that (server, file) pair. An empty diagnostics array clears the entry.
Implementations§
Source§impl DiagnosticsStore
impl DiagnosticsStore
pub fn new() -> Self
Sourcepub fn publish(
&mut self,
server: ServerKind,
file: PathBuf,
diagnostics: Vec<StoredDiagnostic>,
)
pub fn publish( &mut self, server: ServerKind, file: PathBuf, diagnostics: Vec<StoredDiagnostic>, )
Replace diagnostics for a (server, file) pair.
Sourcepub fn for_file(&self, file: &Path) -> Vec<&StoredDiagnostic>
pub fn for_file(&self, file: &Path) -> Vec<&StoredDiagnostic>
Get all diagnostics for a specific file (from all servers).
Sourcepub fn for_directory(&self, dir: &Path) -> Vec<&StoredDiagnostic>
pub fn for_directory(&self, dir: &Path) -> Vec<&StoredDiagnostic>
Get all diagnostics for a directory (all files under it).
Sourcepub fn all(&self) -> Vec<&StoredDiagnostic>
pub fn all(&self) -> Vec<&StoredDiagnostic>
Get all stored diagnostics.
Sourcepub fn clear_server(&mut self, server: ServerKind)
pub fn clear_server(&mut self, server: ServerKind)
Clear all diagnostics for a server (e.g. on server restart).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiagnosticsStore
impl RefUnwindSafe for DiagnosticsStore
impl Send for DiagnosticsStore
impl Sync for DiagnosticsStore
impl Unpin for DiagnosticsStore
impl UnsafeUnpin for DiagnosticsStore
impl UnwindSafe for DiagnosticsStore
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