Class: Spoom::LSP::Diagnostic
- Inherits:
-
T::Struct
- Object
- T::Struct
- Spoom::LSP::Diagnostic
- Includes:
- PrintableSymbol
- Defined in:
- lib/spoom/sorbet/lsp/structures.rb
Class Method Summary collapse
-
.from_json(json) ⇒ Object
: (Hash[untyped, untyped] json) -> Diagnostic.
Instance Method Summary collapse
-
#accept_printer(printer) ⇒ Object
: (SymbolPrinter printer) -> void.
-
#to_s ⇒ Object
: -> String.
Class Method Details
.from_json(json) ⇒ Object
: (Hash[untyped, untyped] json) -> Diagnostic
178 179 180 181 182 183 184 185 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 178 def from_json(json) Diagnostic.new( range: Range.from_json(json["range"]), code: json["code"].to_i, message: json["message"], information: json["relatedInformation"], ) end |
Instance Method Details
#accept_printer(printer) ⇒ Object
: (SymbolPrinter printer) -> void
190 191 192 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 190 def accept_printer(printer) printer.print(to_s) end |
#to_s ⇒ Object
: -> String
195 196 197 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 195 def to_s "Error: #{} (#{code})." end |