File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
lib/ruby_lsp/ruby_lsp_rails Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,7 @@ def initialize
84
84
if @wait_thread . alive?
85
85
$stderr. puts ( "Ruby LSP Rails is force killing the server" )
86
86
sleep ( 0.5 ) # give the server a bit of time if we already issued a shutdown notification
87
-
88
- # Windows does not support the `TERM` signal, so we're forced to use `KILL` here
89
- Process . kill ( T . must ( Signal . list [ "KILL" ] ) , @wait_thread . pid )
87
+ force_kill
90
88
end
91
89
end
92
90
end
@@ -149,6 +147,9 @@ def shutdown
149
147
send_message ( "shutdown" )
150
148
sleep ( 0.5 ) # give the server a bit of time to shutdown
151
149
[ @stdin , @stdout , @stderr ] . each ( &:close )
150
+ rescue IOError
151
+ # The server connection may have died
152
+ force_kill
152
153
end
153
154
154
155
sig { returns ( T ::Boolean ) }
@@ -203,6 +204,12 @@ def read_response
203
204
# The server connection died
204
205
nil
205
206
end
207
+
208
+ sig { void }
209
+ def force_kill
210
+ # Windows does not support the `TERM` signal, so we're forced to use `KILL` here
211
+ Process . kill ( T . must ( Signal . list [ "KILL" ] ) , @wait_thread . pid )
212
+ end
206
213
end
207
214
208
215
class NullClient < RunnerClient
You can’t perform that action at this time.
0 commit comments