pub struct Diagnostic {
pub range: TextRange,
pub severity: Severity,
pub code: String,
pub message: String,
pub source: DiagnosticSource,
pub fixes: Vec<CodeAction>,
pub tags: Vec<DiagnosticTag>,
}Expand description
A diagnostic with a byte range, a stable machine code, a severity, and a message.
Fields§
§range: TextRangeThe byte range the diagnostic applies to.
severity: SeveritySeverity.
code: StringA stable code, e.g. GDSCRIPT_SYNTAX or INTEGER_DIVISION.
message: StringHuman-readable message.
source: DiagnosticSourceWhich analysis layer produced it. Defaults to DiagnosticSource::Syntax so older
serialized diagnostics and Phase-1 call sites round-trip unchanged.
fixes: Vec<CodeAction>Quick-fixes offered for this diagnostic (e.g. “add type annotation”). Empty when none.
LSP-aligned rendering tags (DiagnosticTag) — Unnecessary on the unused/unreachable
family so editors dim it. Omitted from JSON when empty, so pre-tag serialized
diagnostics and consumers round-trip unchanged.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl<'de> Deserialize<'de> for Diagnostic
impl<'de> Deserialize<'de> for Diagnostic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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