Class: Spoom::LSP::Position
- Inherits:
-
T::Struct
- Object
- T::Struct
- Spoom::LSP::Position
- Includes:
- PrintableSymbol
- Defined in:
- lib/spoom/sorbet/lsp/structures.rb
Class Method Summary collapse
-
.from_json(json) ⇒ Object
: (Hash[untyped, untyped] json) -> Position.
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) -> Position
56 57 58 59 60 61 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 56 def from_json(json) Position.new( line: json["line"].to_i, char: json["character"].to_i, ) end |
Instance Method Details
#accept_printer(printer) ⇒ Object
: (SymbolPrinter printer) -> void
66 67 68 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 66 def accept_printer(printer) printer.print_colored("#{line}:#{char}", Color::LIGHT_BLACK) end |
#to_s ⇒ Object
: -> String
71 72 73 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 71 def to_s "#{line}:#{char}" end |