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
241241 sorbet-runtime (>= 0.5.10782 )
242242 ruby-progressbar (1.13.0 )
243243 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 )
252252 spoom (1.3.0 )
253253 erubi (>= 1.10.0 )
254254 prism (>= 0.19.0 )
Original file line number Diff line number Diff line change @@ -11,18 +11,18 @@ class << self
1111 sig { params ( location_string : String ) . returns ( Interface ::Location ) }
1212 def line_location_from_s ( location_string )
1313 *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?
1615
1716 # On Windows, file paths will look something like `C:/path/to/file.rb:123`. Only the last colon is the line
1817 # number and all other parts compose the file path
1918 file_path = file_parts . join ( ":" )
19+ line_as_number = line ? Integer ( line . to_i ) - 1 : 0
2020
2121 Interface ::Location . new (
2222 uri : URI ::Generic . from_path ( path : file_path ) . to_s ,
2323 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 ) ,
2626 ) ,
2727 )
2828 end
You can’t perform that action at this time.
0 commit comments