Skip to content

Commit 41d81e8

Browse files
authored
πŸ‘ support ruby-lsp 0.20.x (#44)
* πŸ‘ support ruby-lsp 0.20.x * πŸ› update rbi files I update rbi files.
1 parent 4aa9e62 commit 41d81e8

File tree

11 files changed

+6127
-1835
lines changed

11 files changed

+6127
-1835
lines changed

β€ŽGemfile.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
ruby-lsp-rspec (0.1.15)
5-
ruby-lsp (~> 0.19.0)
5+
ruby-lsp (~> 0.20.1)
66

77
GEM
88
remote: https://rubygems.org/
@@ -25,13 +25,13 @@ GEM
2525
parser (3.3.5.0)
2626
ast (~> 2.4.1)
2727
racc
28-
prism (1.1.0)
28+
prism (1.2.0)
2929
psych (5.1.2)
3030
stringio
3131
racc (1.8.1)
3232
rainbow (3.1.1)
3333
rake (13.2.1)
34-
rbi (0.2.0)
34+
rbi (0.2.1)
3535
prism (~> 1.0)
3636
sorbet-runtime (>= 0.5.9204)
3737
rbs (3.6.1)
@@ -50,11 +50,11 @@ GEM
5050
rspec-expectations (3.13.3)
5151
diff-lcs (>= 1.2.0, < 2.0)
5252
rspec-support (~> 3.13.0)
53-
rspec-mocks (3.13.1)
53+
rspec-mocks (3.13.2)
5454
diff-lcs (>= 1.2.0, < 2.0)
5555
rspec-support (~> 3.13.0)
5656
rspec-support (3.13.1)
57-
rubocop (1.66.1)
57+
rubocop (1.67.0)
5858
json (~> 2.3)
5959
language_server-protocol (>= 3.17.0)
6060
parallel (~> 1.10)
@@ -70,29 +70,29 @@ GEM
7070
rubocop (~> 1.0)
7171
rubocop-shopify (2.15.1)
7272
rubocop (~> 1.51)
73-
rubocop-sorbet (0.8.5)
73+
rubocop-sorbet (0.8.6)
7474
rubocop (>= 1)
75-
ruby-lsp (0.19.0)
75+
ruby-lsp (0.20.1)
7676
language_server-protocol (~> 3.17.0)
77-
prism (>= 1.1, < 2.0)
77+
prism (>= 1.2, < 2.0)
7878
rbs (>= 3, < 4)
7979
sorbet-runtime (>= 0.5.10782)
8080
ruby-progressbar (1.13.0)
81-
sorbet (0.5.11581)
82-
sorbet-static (= 0.5.11581)
83-
sorbet-runtime (0.5.11581)
84-
sorbet-static (0.5.11581-universal-darwin)
85-
sorbet-static (0.5.11581-x86_64-linux)
86-
sorbet-static-and-runtime (0.5.11581)
87-
sorbet (= 0.5.11581)
88-
sorbet-runtime (= 0.5.11581)
89-
spoom (1.4.2)
81+
sorbet (0.5.11604)
82+
sorbet-static (= 0.5.11604)
83+
sorbet-runtime (0.5.11604)
84+
sorbet-static (0.5.11604-universal-darwin)
85+
sorbet-static (0.5.11604-x86_64-linux)
86+
sorbet-static-and-runtime (0.5.11604)
87+
sorbet (= 0.5.11604)
88+
sorbet-runtime (= 0.5.11604)
89+
spoom (1.5.0)
9090
erubi (>= 1.10.0)
9191
prism (>= 0.28.0)
9292
sorbet-static-and-runtime (>= 0.5.10187)
9393
thor (>= 0.19.2)
9494
stringio (3.1.1)
95-
tapioca (0.16.2)
95+
tapioca (0.16.3)
9696
bundler (>= 2.2.25)
9797
netrc (>= 0.11.0)
9898
parallel (>= 1.21.0)

β€Žlib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ class IndexingEnhancement
1313
owner: T.nilable(RubyIndexer::Entry::Namespace),
1414
node: Prism::CallNode,
1515
file_path: String,
16+
code_units_cache: T.any(
17+
T.proc.params(arg0: Integer).returns(Integer),
18+
Prism::CodeUnitsCache,
19+
),
1620
).void
1721
end
18-
def on_call_node(index, owner, node, file_path)
22+
def on_call_node(index, owner, node, file_path, code_units_cache)
1923
return if node.receiver
2024

2125
name = node.name
@@ -44,10 +48,9 @@ def on_call_node(index, owner, node, file_path)
4448
index.add(RubyIndexer::Entry::Method.new(
4549
method_name,
4650
file_path,
47-
block_node.location,
48-
block_node.location,
51+
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
52+
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
4953
nil,
50-
index.configuration.encoding,
5154
[RubyIndexer::Entry::Signature.new([])],
5255
RubyIndexer::Entry::Visibility::PUBLIC,
5356
owner,
@@ -78,10 +81,9 @@ def on_call_node(index, owner, node, file_path)
7881
index.add(RubyIndexer::Entry::Method.new(
7982
method_name,
8083
file_path,
81-
block_node.location,
82-
block_node.location,
84+
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
85+
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
8386
nil,
84-
index.configuration.encoding,
8587
[RubyIndexer::Entry::Signature.new([])],
8688
RubyIndexer::Entry::Visibility::PUBLIC,
8789
owner,

β€Žruby-lsp-rspec.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
4141
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
4242
spec.require_paths = ["lib"]
4343

44-
spec.add_dependency "ruby-lsp", "~> 0.19.0"
44+
spec.add_dependency "ruby-lsp", "~> 0.20.1"
4545
end

0 commit comments

Comments
Β (0)