Class: Spoom::LSP::Position

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



61
62
63
64
65
66
# File 'lib/spoom/sorbet/lsp/structures.rb', line 61

def from_json(json)
  Position.new(
    line: json["line"].to_i,
    char: json["character"].to_i,
  )
end

Instance Method Details

#accept_printer(printer) ⇒ Object



70
71
72
# File 'lib/spoom/sorbet/lsp/structures.rb', line 70

def accept_printer(printer)
  printer.print_colored("#{line}:#{char}", Color::LIGHT_BLACK)
end

#to_sObject



75
76
77
# File 'lib/spoom/sorbet/lsp/structures.rb', line 75

def to_s
  "#{line}:#{char}"
end