File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/ruby_lsp/ruby_lsp_rails Expand file tree Collapse file tree 1 file changed +9
-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 ) }
@@ -229,6 +230,11 @@ def rails_root
229
230
230
231
private
231
232
233
+ def force_kill
234
+ # Windows does not support the `TERM` signal, so we're forced to use `KILL` here
235
+ Process . kill ( T . must ( Signal . list [ "KILL" ] ) , @wait_thread . pid )
236
+ end
237
+
232
238
sig { override . params ( request : String , params : T . nilable ( T ::Hash [ Symbol , T . untyped ] ) ) . void }
233
239
def send_message ( request , params = nil )
234
240
# no-op
You can’t perform that action at this time.
0 commit comments