Class: Spoom::LSP::Location

Inherits:
T::Struct
  • Object
show all
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

: (Hash[untyped, untyped] json) -> Location



111
112
113
114
115
116
# File 'lib/spoom/sorbet/lsp/structures.rb', line 111

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

Instance Method Details

#accept_printer(printer) ⇒ Object

: (SymbolPrinter printer) -> void



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

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

#to_sObject

: -> String



127
128
129
# File 'lib/spoom/sorbet/lsp/structures.rb', line 127

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