12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/ruby_lsp/ruby_lsp_rails/support/location_builder.rb', line 12
def line_location_from_s(location_string)
*file_parts, line = location_string.split(":")
raise ArgumentError, "Invalid location string given" unless file_parts
file_path = file_parts.join(":")
Interface::Location.new(
uri: URI::Generic.from_path(path: file_path).to_s,
range: Interface::Range.new(
start: Interface::Position.new(line: Integer(line) - 1, character: 0),
end: Interface::Position.new(line: Integer(line) - 1, character: 0),
),
)
end
|