Struct lsp_types::Diagnostic [−][src]
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
Fields
range: RangeThe range at which the message applies.
severity: Option<DiagnosticSeverity>The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
code: Option<NumberOrString>The diagnostic's code. Can be omitted.
code_description: Option<CodeDescription>An optional property to describe the error code.
since 3.16.0
source: Option<String>A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
message: StringThe diagnostic's message.
An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.
Additional metadata about the diagnostic.
data: Option<Value>A data entry field that is preserved between a textDocument/publishDiagnostics
notification and textDocument/codeAction request.
since 3.16.0
Implementations
impl Diagnostic[src]
pub fn new(
range: Range,
severity: Option<DiagnosticSeverity>,
code: Option<NumberOrString>,
source: Option<String>,
message: String,
related_information: Option<Vec<DiagnosticRelatedInformation>>,
tags: Option<Vec<DiagnosticTag>>
) -> Diagnostic[src]
range: Range,
severity: Option<DiagnosticSeverity>,
code: Option<NumberOrString>,
source: Option<String>,
message: String,
related_information: Option<Vec<DiagnosticRelatedInformation>>,
tags: Option<Vec<DiagnosticTag>>
) -> Diagnostic
pub fn new_simple(range: Range, message: String) -> Diagnostic[src]
pub fn new_with_code_number(
range: Range,
severity: DiagnosticSeverity,
code_number: i32,
source: Option<String>,
message: String
) -> Diagnostic[src]
range: Range,
severity: DiagnosticSeverity,
code_number: i32,
source: Option<String>,
message: String
) -> Diagnostic
Trait Implementations
impl Clone for Diagnostic[src]
fn clone(&self) -> Diagnostic[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for Diagnostic[src]
impl Default for Diagnostic[src]
fn default() -> Diagnostic[src]
impl<'de> Deserialize<'de> for Diagnostic[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Eq for Diagnostic[src]
impl PartialEq<Diagnostic> for Diagnostic[src]
fn eq(&self, other: &Diagnostic) -> bool[src]
fn ne(&self, other: &Diagnostic) -> bool[src]
impl Serialize for Diagnostic[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralEq for Diagnostic[src]
impl StructuralPartialEq for Diagnostic[src]
Auto Trait Implementations
impl RefUnwindSafe for Diagnostic[src]
impl Send for Diagnostic[src]
impl Sync for Diagnostic[src]
impl Unpin for Diagnostic[src]
impl UnwindSafe for Diagnostic[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,