class LSProtocol::Diagnostic

Overview

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.

Included Modules

Defined in:

lsprotocol/types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(message : String | Nil, range : Range | Nil, code : Int32 | String | Nil = nil, code_description : CodeDescription | Nil = nil, data : LSPAny | Nil = nil, related_information : Array(DiagnosticRelatedInformation) | Nil = nil, severity : DiagnosticSeverity | Nil = nil, source : String | Nil = nil, tags : Array(DiagnosticTag) | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def code : Int32 | String | Nil #

The diagnostic's code, which usually appear in the user interface.


[View source]
def code_description : CodeDescription | Nil #

An optional property to describe the error code. Requires the code field (above) to be present/not null.

@since 3.16.0


[View source]
def data : LSPAny | Nil #

A data entry field that is preserved between a textDocument/publishDiagnostics notification and textDocument/codeAction request.

@since 3.16.0


[View source]
def message : String #

The diagnostic's message. It usually appears in the user interface


[View source]
def range : Range #

The range at which the message applies


[View source]
def related_information : Array(DiagnosticRelatedInformation) | Nil #

An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.


[View source]
def severity : DiagnosticSeverity | Nil #

The diagnostic's severity. To avoid interpretation mismatches when a server is used with different clients it is highly recommended that servers always provide a severity value.


[View source]
def source : String | Nil #

A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'. It usually appears in the user interface.


[View source]
def tags : Array(DiagnosticTag) | Nil #

Additional metadata about the diagnostic.

@since 3.15.0


[View source]