Skip to content

Commit

Permalink
Typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Dec 17, 2024
1 parent c8a0d1b commit 5ece646
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/ruby_lsp/ruby_lsp_rails/test_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module RubyLsp
module Rails
module TestUtils
extend T::Sig
extend T::Helpers
include Minitest::Assertions # to prevent Sorbet complaining

sig { params(server: RubyLsp::Server).returns(RubyLsp::Result) }
def pop_result(server)
Expand All @@ -19,6 +21,8 @@ def pop_result(server)
T.cast(result, RubyLsp::Result)
end

# TODO: write correct sig
sig { params(message_queue: T.untyped, type: T.untyped).returns(T.untyped) }
def pop_log_notification(message_queue, type)
log = message_queue.pop
return log if log.params.type == type
Expand All @@ -27,6 +31,8 @@ def pop_log_notification(message_queue, type)
log
end

# TODO: write correct sig
sig { params(outgoing_queue: T.untyped, block: T.untyped).returns(T.untyped) }
def pop_message(outgoing_queue, &block)
message = outgoing_queue.pop
return message if block.call(message)
Expand Down

0 comments on commit 5ece646

Please sign in to comment.