File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
lib/ruby_lsp/ruby_lsp_rails/support Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -241,14 +241,14 @@ GEM
241
241
sorbet-runtime (>= 0.5.10782 )
242
242
ruby-progressbar (1.13.0 )
243
243
ruby2_keywords (0.0.5 )
244
- sorbet (0.5.11406 )
245
- sorbet-static (= 0.5.11406 )
246
- sorbet-runtime (0.5.11406 )
247
- sorbet-static (0.5.11406 -universal-darwin )
248
- sorbet-static (0.5.11406 -x86_64-linux )
249
- sorbet-static-and-runtime (0.5.11406 )
250
- sorbet (= 0.5.11406 )
251
- sorbet-runtime (= 0.5.11406 )
244
+ sorbet (0.5.11554 )
245
+ sorbet-static (= 0.5.11554 )
246
+ sorbet-runtime (0.5.11554 )
247
+ sorbet-static (0.5.11554 -universal-darwin )
248
+ sorbet-static (0.5.11554 -x86_64-linux )
249
+ sorbet-static-and-runtime (0.5.11554 )
250
+ sorbet (= 0.5.11554 )
251
+ sorbet-runtime (= 0.5.11554 )
252
252
spoom (1.3.0 )
253
253
erubi (>= 1.10.0 )
254
254
prism (>= 0.19.0 )
Original file line number Diff line number Diff line change @@ -11,18 +11,18 @@ class << self
11
11
sig { params ( location_string : String ) . returns ( Interface ::Location ) }
12
12
def line_location_from_s ( location_string )
13
13
*file_parts , line = location_string . split ( ":" )
14
-
15
- raise ArgumentError , "Invalid location string given" unless file_parts
14
+ raise ArgumentError , "Invalid location string given" if file_parts . empty?
16
15
17
16
# On Windows, file paths will look something like `C:/path/to/file.rb:123`. Only the last colon is the line
18
17
# number and all other parts compose the file path
19
18
file_path = file_parts . join ( ":" )
19
+ line_as_number = line ? Integer ( line . to_i ) - 1 : 0
20
20
21
21
Interface ::Location . new (
22
22
uri : URI ::Generic . from_path ( path : file_path ) . to_s ,
23
23
range : Interface ::Range . new (
24
- start : Interface ::Position . new ( line : Integer ( line ) - 1 , character : 0 ) ,
25
- end : Interface ::Position . new ( line : Integer ( line ) - 1 , character : 0 ) ,
24
+ start : Interface ::Position . new ( line : line_as_number , character : 0 ) ,
25
+ end : Interface ::Position . new ( line : line_as_number , character : 0 ) ,
26
26
) ,
27
27
)
28
28
end
You can’t perform that action at this time.
0 commit comments