Class: Spoom::LSP::Diagnostic

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
PrintableSymbol
Defined in:
lib/spoom/sorbet/lsp/structures.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_json(json) ⇒ Object



156
157
158
159
160
161
162
163
# File 'lib/spoom/sorbet/lsp/structures.rb', line 156

def self.from_json(json)
  Diagnostic.new(
    range: Range.from_json(json['range']),
    code: json['code'].to_i,
    message: json['message'],
    informations: json['relatedInformation']
  )
end

Instance Method Details

#accept_printer(printer) ⇒ Object



166
167
168
# File 'lib/spoom/sorbet/lsp/structures.rb', line 166

def accept_printer(printer)
  printer.print(to_s)
end

#to_sObject



170
171
172
# File 'lib/spoom/sorbet/lsp/structures.rb', line 170

def to_s
  "Error: #{message} (#{code})."
end