@@ -49,8 +49,8 @@ class EmptyMessageError < MessageError; end
4949
5050 #: (Thread::Queue outgoing_queue, RubyLsp::GlobalState global_state) -> void
5151 def initialize ( outgoing_queue , global_state )
52- @outgoing_queue = T . let ( outgoing_queue , Thread ::Queue )
53- @mutex = T . let ( Mutex . new , Mutex )
52+ @outgoing_queue = outgoing_queue #: Thread::Queue
53+ @mutex = Mutex . new #: Mutex
5454 # Spring needs a Process session ID. It uses this ID to "attach" itself to the parent process, so that when the
5555 # parent ends, the spring process ends as well. If this is not set, Spring will throw an error while trying to
5656 # set its own session ID
@@ -78,21 +78,21 @@ def initialize(outgoing_queue, global_state)
7878 )
7979 end
8080
81- @stdin = T . let ( stdin , IO )
82- @stdout = T . let ( stdout , IO )
83- @stderr = T . let ( stderr , IO )
81+ @stdin = stdin #: IO
82+ @stdout = stdout #: IO
83+ @stderr = stderr #: IO
8484 @stdin . sync = true
8585 @stdout . sync = true
8686 @stderr . sync = true
87- @wait_thread = T . let ( wait_thread , Process ::Waiter )
87+ @wait_thread = wait_thread #: Process::Waiter
8888
8989 # We set binmode for Windows compatibility
9090 @stdin . binmode
9191 @stdout . binmode
9292 @stderr . binmode
9393
94- initialize_response = T . must ( read_response )
95- @rails_root = T . let ( initialize_response [ :root ] , String )
94+ initialize_response = read_response #: as !nil
95+ @rails_root = initialize_response [ :root ] #: String
9696 log_message ( "Finished booting Ruby LSP Rails server" )
9797
9898 unless ENV [ "RAILS_ENV" ] == "test"
@@ -106,20 +106,17 @@ def initialize(outgoing_queue, global_state)
106106
107107 # Responsible for transmitting notifications coming from the server to the outgoing queue, so that we can do
108108 # things such as showing progress notifications initiated by the server
109- @notifier_thread = T . let (
110- Thread . new do
111- until @stderr . closed?
112- notification = read_notification
113-
114- unless @outgoing_queue . closed? || !notification
115- @outgoing_queue << notification
116- end
109+ @notifier_thread = Thread . new do
110+ until @stderr . closed?
111+ notification = read_notification
112+
113+ unless @outgoing_queue . closed? || !notification
114+ @outgoing_queue << notification
117115 end
118- rescue IOError
119- # The server was shutdown and stderr is already closed
120- end ,
121- Thread ,
122- )
116+ end
117+ rescue IOError
118+ # The server was shutdown and stderr is already closed
119+ end #: Thread
123120 rescue StandardError
124121 raise InitializationError , @stderr . read
125122 end
@@ -298,9 +295,9 @@ def read_response
298295 raise EmptyMessageError unless content_length
299296
300297 @stdout . read ( content_length )
301- end
298+ end #: as !nil
302299
303- response = JSON . parse ( T . must ( raw_response ) , symbolize_names : true )
300+ response = JSON . parse ( raw_response , symbolize_names : true )
304301
305302 if response [ :error ]
306303 log_message (
@@ -319,7 +316,10 @@ def read_response
319316 #: -> void
320317 def force_kill
321318 # Windows does not support the `TERM` signal, so we're forced to use `KILL` here
322- Process . kill ( T . must ( Signal . list [ "KILL" ] ) , @wait_thread . pid )
319+ Process . kill (
320+ Signal . list [ "KILL" ] , #: as !nil
321+ @wait_thread . pid ,
322+ )
323323 end
324324
325325 #: (::String message, ?type: ::Integer) -> void
0 commit comments