Skip to content

Commit

Permalink
Upgrade Sorbet (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Sep 5, 2024
1 parent ab6dbc4 commit 0ae85ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ GEM
sorbet-runtime (>= 0.5.10782)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sorbet (0.5.11406)
sorbet-static (= 0.5.11406)
sorbet-runtime (0.5.11406)
sorbet-static (0.5.11406-universal-darwin)
sorbet-static (0.5.11406-x86_64-linux)
sorbet-static-and-runtime (0.5.11406)
sorbet (= 0.5.11406)
sorbet-runtime (= 0.5.11406)
sorbet (0.5.11554)
sorbet-static (= 0.5.11554)
sorbet-runtime (0.5.11554)
sorbet-static (0.5.11554-universal-darwin)
sorbet-static (0.5.11554-x86_64-linux)
sorbet-static-and-runtime (0.5.11554)
sorbet (= 0.5.11554)
sorbet-runtime (= 0.5.11554)
spoom (1.3.0)
erubi (>= 1.10.0)
prism (>= 0.19.0)
Expand Down
8 changes: 4 additions & 4 deletions lib/ruby_lsp/ruby_lsp_rails/support/location_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ class << self
sig { params(location_string: String).returns(Interface::Location) }
def line_location_from_s(location_string)
*file_parts, line = location_string.split(":")

raise ArgumentError, "Invalid location string given" unless file_parts
raise ArgumentError, "Invalid location string given" if file_parts.empty?

# On Windows, file paths will look something like `C:/path/to/file.rb:123`. Only the last colon is the line
# number and all other parts compose the file path
file_path = file_parts.join(":")
line_as_number = line ? Integer(line.to_i) - 1 : 0

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),
start: Interface::Position.new(line: line_as_number, character: 0),
end: Interface::Position.new(line: line_as_number, character: 0),
),
)
end
Expand Down

0 comments on commit 0ae85ad

Please sign in to comment.