Skip to content

Commit

Permalink
Bump ruby-lsp to 0.21 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 authored Nov 2, 2024
1 parent be61028 commit 0d13ed3
Show file tree
Hide file tree
Showing 12 changed files with 1,860 additions and 1,046 deletions.
32 changes: 16 additions & 16 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.17)
ruby-lsp (~> 0.20.1)
ruby-lsp (~> 0.21.0)

GEM
remote: https://rubygems.org/
Expand All @@ -17,12 +17,12 @@ GEM
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
json (2.7.5)
language_server-protocol (3.17.0.3)
logger (1.6.1)
netrc (0.11.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
prism (1.2.0)
Expand All @@ -45,7 +45,7 @@ GEM
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.1)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -54,7 +54,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.67.0)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -64,28 +64,28 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.33.0)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
rubocop-sorbet (0.8.6)
rubocop-sorbet (0.8.7)
rubocop (>= 1)
ruby-lsp (0.20.1)
ruby-lsp (0.21.2)
language_server-protocol (~> 3.17.0)
prism (>= 1.2, < 2.0)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)
ruby-progressbar (1.13.0)
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)
sorbet (0.5.11633)
sorbet-static (= 0.5.11633)
sorbet-runtime (0.5.11633)
sorbet-static (0.5.11633-universal-darwin)
sorbet-static (0.5.11633-x86_64-linux)
sorbet-static-and-runtime (0.5.11633)
sorbet (= 0.5.11633)
sorbet-runtime (= 0.5.11633)
spoom (1.5.0)
erubi (>= 1.10.0)
prism (>= 0.28.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/ruby_lsp_rspec/addon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Addon < ::RubyLsp::Addon
sig { override.params(global_state: GlobalState, message_queue: Thread::Queue).void }
def activate(global_state, message_queue)
@index = T.let(global_state.index, T.nilable(RubyIndexer::Index))
global_state.index.register_enhancement(IndexingEnhancement.new)
global_state.index.register_enhancement(IndexingEnhancement.new(global_state.index))
end

sig { override.void }
Expand Down
10 changes: 4 additions & 6 deletions lib/ruby_lsp/ruby_lsp_rspec/indexing_enhancement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

module RubyLsp
module RSpec
class IndexingEnhancement
class IndexingEnhancement < RubyIndexer::Enhancement
extend T::Sig
include RubyIndexer::Enhancement

sig do
override.params(
index: RubyIndexer::Index,
owner: T.nilable(RubyIndexer::Entry::Namespace),
node: Prism::CallNode,
file_path: String,
Expand All @@ -19,7 +17,7 @@ class IndexingEnhancement
),
).void
end
def on_call_node(index, owner, node, file_path, code_units_cache)
def on_call_node_enter(owner, node, file_path, code_units_cache)
return if node.receiver

name = node.name
Expand All @@ -45,7 +43,7 @@ def on_call_node(index, owner, node, file_path, code_units_cache)

return unless method_name

index.add(RubyIndexer::Entry::Method.new(
@index.add(RubyIndexer::Entry::Method.new(
method_name,
file_path,
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
Expand Down Expand Up @@ -78,7 +76,7 @@ def on_call_node(index, owner, node, file_path, code_units_cache)

return unless method_name

index.add(RubyIndexer::Entry::Method.new(
@index.add(RubyIndexer::Entry::Method.new(
method_name,
file_path,
RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
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.20.1"
spec.add_dependency "ruby-lsp", "~> 0.21.0"
end
Loading

0 comments on commit 0d13ed3

Please sign in to comment.