Lines Matching full:diagnostic
1 //! Diagnostic data structures.
7 /// A severity level for diagnostic messages.
12 /// use codespan_reporting::diagnostic::Severity;
56 /// Labels that describe the primary cause of a diagnostic.
58 /// Labels that provide additional context for a diagnostic.
62 /// A label describing an underlined region of code associated with a diagnostic.
106 /// Add a message to the diagnostic.
113 /// Represents a diagnostic message that can provide information like errors and
116 …Diagnostic is considered to be the position of the [`Label`] that has the earliest starting positi…
119 pub struct Diagnostic<FileId> { struct
120 /// The overall severity of the diagnostic
122 /// An optional code that identifies this diagnostic.
124 /// The main message associated with this diagnostic.
127 /// diagnostic display mod, the message should be specific enough to make
130 /// Source labels that describe the cause of the diagnostic.
134 /// Notes that are associated with the primary cause of the diagnostic.
139 impl<FileId> Diagnostic<FileId> { argument
140 /// Create a new diagnostic.
141 pub fn new(severity: Severity) -> Diagnostic<FileId> { in new()
142 Diagnostic { in new()
151 /// Create a new diagnostic with a severity of [`Severity::Bug`].
154 pub fn bug() -> Diagnostic<FileId> { in bug()
155 Diagnostic::new(Severity::Bug) in bug()
158 /// Create a new diagnostic with a severity of [`Severity::Error`].
161 pub fn error() -> Diagnostic<FileId> { in error()
162 Diagnostic::new(Severity::Error) in error()
165 /// Create a new diagnostic with a severity of [`Severity::Warning`].
168 pub fn warning() -> Diagnostic<FileId> { in warning()
169 Diagnostic::new(Severity::Warning) in warning()
172 /// Create a new diagnostic with a severity of [`Severity::Note`].
175 pub fn note() -> Diagnostic<FileId> { in note()
176 Diagnostic::new(Severity::Note) in note()
179 /// Create a new diagnostic with a severity of [`Severity::Help`].
182 pub fn help() -> Diagnostic<FileId> { in help()
183 Diagnostic::new(Severity::Help) in help()
186 /// Set the error code of the diagnostic.
187 pub fn with_code(mut self, code: impl Into<String>) -> Diagnostic<FileId> { in with_code()
192 /// Set the message of the diagnostic.
193 pub fn with_message(mut self, message: impl Into<String>) -> Diagnostic<FileId> { in with_message()
198 /// Add some labels to the diagnostic.
199 pub fn with_labels(mut self, mut labels: Vec<Label<FileId>>) -> Diagnostic<FileId> { in with_labels()
204 /// Add some notes to the diagnostic.
205 pub fn with_notes(mut self, mut notes: Vec<String>) -> Diagnostic<FileId> { in with_notes()