Class: Spoom::LSP::Range

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



80
81
82
83
84
85
# File 'lib/spoom/sorbet/lsp/structures.rb', line 80

def self.from_json(json)
  Range.new(
    start: Position.from_json(json['start']),
    end: Position.from_json(json['end'])
  )
end

Instance Method Details

#accept_printer(printer) ⇒ Object



88
89
90
91
92
# File 'lib/spoom/sorbet/lsp/structures.rb', line 88

def accept_printer(printer)
  printer.print_object(start)
  printer.print_colored("-", Color::LIGHT_BLACK)
  printer.print_object(self.end)
end

#to_sObject



95
96
97
# File 'lib/spoom/sorbet/lsp/structures.rb', line 95

def to_s
  "#{start}-#{self.end}"
end