Class: Spoom::LSP::Diagnostic

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/spoom/sorbet/lsp/structures.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_json(json) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/spoom/sorbet/lsp/structures.rb', line 121

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

#to_sObject



130
131
132
# File 'lib/spoom/sorbet/lsp/structures.rb', line 130

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