File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
lib/ruby_lsp/ruby_lsp_rails Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ def model(name)
66
66
67
67
sig { void }
68
68
def shutdown
69
- send_notification ( "shutdown" )
70
- Thread . pass while @wait_thread . alive?
69
+ warn ( "Ruby LSP Rails shutting down server" )
70
+ send_message ( "shutdown" )
71
+ sleep ( 0.1 ) if @wait_thread . alive? # give the server a bit of time to shutdown
71
72
[ @stdin , @stdout , @stderr ] . each ( &:close )
72
73
end
73
74
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ def initialize
38
38
39
39
sig { void }
40
40
def start
41
+ # Put this process into the same process group as the parent one, so that it gets terminated when the parent
42
+ # does
43
+ pgid = Process . getpgid ( Process . getsid )
44
+ Process . setpgid ( 0 , pgid )
45
+
41
46
initialize_result = { result : { message : "ok" } } . to_json
42
47
$stdout. write ( "Content-Length: #{ initialize_result . length } \r \n \r \n #{ initialize_result } " )
43
48
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class RunnerClientTest < ActiveSupport::TestCase
14
14
end
15
15
16
16
teardown do
17
- @client . shutdown
17
+ capture_subprocess_io { @client . shutdown }
18
18
assert_predicate @client , :stopped?
19
19
end
20
20
You can’t perform that action at this time.
0 commit comments