Skip to content

Commit

Permalink
Accept keyword splat options for server initialization (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Oct 21, 2024
1 parent 91576cb commit ec3103d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ruby_lsp/base_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class BaseServer

abstract!

sig { params(test_mode: T::Boolean).void }
def initialize(test_mode: false)
@test_mode = T.let(test_mode, T::Boolean)
sig { params(options: T::Boolean).void }
def initialize(**options)
@test_mode = T.let(options[:test_mode], T.nilable(T::Boolean))
@writer = T.let(Transport::Stdio::Writer.new, Transport::Stdio::Writer)
@reader = T.let(Transport::Stdio::Reader.new, Transport::Stdio::Reader)
@incoming_queue = T.let(Thread::Queue.new, Thread::Queue)
Expand All @@ -22,7 +22,7 @@ def initialize(test_mode: false)
@store = T.let(Store.new, Store)
@outgoing_dispatcher = T.let(
Thread.new do
unless test_mode
unless @test_mode
while (message = @outgoing_queue.pop)
@mutex.synchronize { @writer.write(message.to_hash) }
end
Expand Down

0 comments on commit ec3103d

Please sign in to comment.