Class: Spoom::LSP::Location

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



108
109
110
111
112
113
# File 'lib/spoom/sorbet/lsp/structures.rb', line 108

def self.from_json(json)
  Location.new(
    uri: json['uri'],
    range: Range.from_json(json['range'])
  )
end

Instance Method Details

#accept_printer(printer) ⇒ Object



116
117
118
119
# File 'lib/spoom/sorbet/lsp/structures.rb', line 116

def accept_printer(printer)
  printer.print_colored("#{printer.clean_uri(uri)}:", Color::LIGHT_BLACK)
  printer.print_object(range)
end

#to_sObject



122
123
124
# File 'lib/spoom/sorbet/lsp/structures.rb', line 122

def to_s
  "#{uri}:#{range}"
end