Skip to content

Commit

Permalink
πŸ‘ support ruby-lsp 0.20.x (#44)
Browse files Browse the repository at this point in the history
* πŸ‘ support ruby-lsp 0.20.x

* πŸ› update rbi files

I update rbi files.
  • Loading branch information
byplayer authored Oct 19, 2024
1 parent 4aa9e62 commit 41d81e8
Show file tree
Hide file tree
Showing 11 changed files with 6,127 additions and 1,835 deletions.
36 changes: 18 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
ruby-lsp-rspec (0.1.15)
ruby-lsp (~> 0.19.0)
ruby-lsp (~> 0.20.1)

GEM
remote: https://rubygems.org/
Expand All @@ -25,13 +25,13 @@ GEM
parser (3.3.5.0)
ast (~> 2.4.1)
racc
prism (1.1.0)
prism (1.2.0)
psych (5.1.2)
stringio
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rbi (0.2.0)
rbi (0.2.1)
prism (~> 1.0)
sorbet-runtime (>= 0.5.9204)
rbs (3.6.1)
Expand All @@ -50,11 +50,11 @@ GEM
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.66.1)
rubocop (1.67.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -70,29 +70,29 @@ GEM
rubocop (~> 1.0)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
rubocop-sorbet (0.8.5)
rubocop-sorbet (0.8.6)
rubocop (>= 1)
ruby-lsp (0.19.0)
ruby-lsp (0.20.1)
language_server-protocol (~> 3.17.0)
prism (>= 1.1, < 2.0)
prism (>= 1.2, < 2.0)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)
ruby-progressbar (1.13.0)
sorbet (0.5.11581)
sorbet-static (= 0.5.11581)
sorbet-runtime (0.5.11581)
sorbet-static (0.5.11581-universal-darwin)
sorbet-static (0.5.11581-x86_64-linux)
sorbet-static-and-runtime (0.5.11581)
sorbet (= 0.5.11581)
sorbet-runtime (= 0.5.11581)
spoom (1.4.2)
sorbet (0.5.11604)
sorbet-static (= 0.5.11604)
sorbet-runtime (0.5.11604)
sorbet-static (0.5.11604-universal-darwin)
sorbet-static (0.5.11604-x86_64-linux)
sorbet-static-and-runtime (0.5.11604)
sorbet (= 0.5.11604)
sorbet-runtime (= 0.5.11604)
spoom (1.5.0)
erubi (>= 1.10.0)
prism (>= 0.28.0)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
stringio (3.1.1)
tapioca (0.16.2)
tapioca (0.16.3)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
Expand Down
16 changes: 9 additions & 7 deletions lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ class IndexingEnhancement
owner: T.nilable(RubyIndexer::Entry::Namespace),
node: Prism::CallNode,
file_path: String,
code_units_cache: T.any(
T.proc.params(arg0: Integer).returns(Integer),
Prism::CodeUnitsCache,
),
).void
end
def on_call_node(index, owner, node, file_path)
def on_call_node(index, owner, node, file_path, code_units_cache)
return if node.receiver

name = node.name
Expand Down Expand Up @@ -44,10 +48,9 @@ def on_call_node(index, owner, node, file_path)
index.add(RubyIndexer::Entry::Method.new(
method_name,
file_path,
block_node.location,
block_node.location,
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
nil,
index.configuration.encoding,
[RubyIndexer::Entry::Signature.new([])],
RubyIndexer::Entry::Visibility::PUBLIC,
owner,
Expand Down Expand Up @@ -78,10 +81,9 @@ def on_call_node(index, owner, node, file_path)
index.add(RubyIndexer::Entry::Method.new(
method_name,
file_path,
block_node.location,
block_node.location,
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
nil,
index.configuration.encoding,
[RubyIndexer::Entry::Signature.new([])],
RubyIndexer::Entry::Visibility::PUBLIC,
owner,
Expand Down
2 changes: 1 addition & 1 deletion ruby-lsp-rspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "ruby-lsp", "~> 0.19.0"
spec.add_dependency "ruby-lsp", "~> 0.20.1"
end
Loading

0 comments on commit 41d81e8

Please sign in to comment.