pub struct DiagnosticCollection { /* private fields */ }Expand description
Container storing live syntax diagnostics alongside user/LSP-provided diagnostics.
Implementations§
Source§impl DiagnosticCollection
impl DiagnosticCollection
pub fn new() -> Self
Sourcepub fn set_include_syntax_diagnostics(&mut self, enabled: bool)
pub fn set_include_syntax_diagnostics(&mut self, enabled: bool)
Enables or disables automatic inclusion of real-time syntax diagnostics.
Sourcepub fn set_syntax_diagnostics(&mut self, diags: Vec<SyntaxDiagnostic>)
pub fn set_syntax_diagnostics(&mut self, diags: Vec<SyntaxDiagnostic>)
Replaces the live syntax diagnostics produced by SyntaxHighlighter.
Sourcepub fn set_external(&mut self, diagnostics: Vec<EditorDiagnostic>)
pub fn set_external(&mut self, diagnostics: Vec<EditorDiagnostic>)
Replaces external/LSP diagnostics without touching live syntax diagnostics.
Sourcepub fn push_external(&mut self, diagnostic: EditorDiagnostic)
pub fn push_external(&mut self, diagnostic: EditorDiagnostic)
Appends a single external diagnostic.
Sourcepub fn clear_external(&mut self)
pub fn clear_external(&mut self)
Clears external diagnostics.
Sourcepub fn iter(&self) -> impl Iterator<Item = &EditorDiagnostic>
pub fn iter(&self) -> impl Iterator<Item = &EditorDiagnostic>
Iterates over all active diagnostics (syntax + external).
Sourcepub fn all_sorted(&self) -> Vec<EditorDiagnostic>
pub fn all_sorted(&self) -> Vec<EditorDiagnostic>
Collects all active diagnostics sorted by (start, severity desc).
Sourcepub fn diagnostics_on_line(&self, line: usize) -> Vec<&EditorDiagnostic>
pub fn diagnostics_on_line(&self, line: usize) -> Vec<&EditorDiagnostic>
Returns all diagnostics overlapping line.
Sourcepub fn max_severity_on_line(&self, line: usize) -> Option<DiagnosticSeverity>
pub fn max_severity_on_line(&self, line: usize) -> Option<DiagnosticSeverity>
Returns the highest severity present on line, if any.
Sourcepub fn counts(&self) -> DiagnosticCounts
pub fn counts(&self) -> DiagnosticCounts
Counts errors, warnings, info, and hints across the document.
Trait Implementations§
Source§impl Clone for DiagnosticCollection
impl Clone for DiagnosticCollection
Source§impl Debug for DiagnosticCollection
impl Debug for DiagnosticCollection
Auto Trait Implementations§
impl Forget for DiagnosticCollection
impl Freeze for DiagnosticCollection
impl Move for DiagnosticCollection
impl RefUnwindSafe for DiagnosticCollection
impl Send for DiagnosticCollection
impl Sync for DiagnosticCollection
impl Unpin for DiagnosticCollection
impl UnsafeUnpin for DiagnosticCollection
impl UnwindSafe for DiagnosticCollection
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