Creates a new diagnostic object.
The range to which this diagnostic applies.
The human-readable message.
Optionalseverity: DiagnosticSeverityThe severity, default is error.
OptionalcodeA code or identifier for this diagnostic. Should be used for later processing, e.g. when providing code actions.
A target URI to open with more information about the diagnostic error.
A code or identifier for this diagnostic. Should be used for later processing, e.g. when providing code actions.
OptionaldataA data entry field that is preserved between diagnostics and code actions.
The human-readable message.
The range to which this diagnostic applies.
OptionalrelatedAn array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.
The severity, default is error.
OptionalsourceA human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
OptionaltagsAdditional metadata about the diagnostic.
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a file.