Skip to content

Commit

Permalink
Add shim for @index
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Oct 31, 2024
1 parent 144a687 commit 6698760
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/ruby_lsp/ruby_lsp_rails/indexing_enhancement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ module Rails
class IndexingEnhancement < RubyIndexer::Enhancement
extend T::Sig

sig { params(index: RubyIndexer::Index).void }
def initialize(index)
super
@index = index
end

sig do
override.params(
owner: T.nilable(RubyIndexer::Entry::Namespace),
Expand Down
11 changes: 11 additions & 0 deletions sorbet/rbi/shims/ruby_lsp.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# typed: strict
# frozen_string_literal: true

module RubyIndexer
class Enhancement
# If we change ruby-lsp to use a `T.let` then this can be removed
def initialize(index)
@index = T.let(index, RubyIndexer::Index)
end
end
end

0 comments on commit 6698760

Please sign in to comment.