ruby-lsp-rails 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75f1c942c624b415b9ac1207d42c3cd0d32fe5403ef49626c3be6f18f8cb3682
4
- data.tar.gz: 7a6740caeae1fd86c55f917bd3ae59c1b1fc4d0080875ee37875e04ad3dc8c55
3
+ metadata.gz: 7b68f8a0b2e4d7d4fa32aa2712865dea5c4734c86aa6a490c2a7ace718e3405a
4
+ data.tar.gz: a146d2ff4091073a9517147dffd3f5326337b947563ed39848d3a823662b5fdc
5
5
  SHA512:
6
- metadata.gz: 8a86197ecdea2653c87dfb3d79b092681504391fd76e1a0849b754aca21b60fdcc8855f6c4d8fab4ee8e9a1816a1e39d896311bf30f558fb8a9b195ac6de3711
7
- data.tar.gz: f295e7756887b52128eafd56a1cbb70017c48f0128c1f82d521b81098e50c894ae1c32f97c66dddd3752a62a5a9171f35dd7368ef6444a13acb467a368cd5cee
6
+ metadata.gz: 8902056649daff38b9c6e73231ecc0fb55485d4789d52b9dbf92afe4983104082a959b242b1a9f898d3697344663a678da952b0c0a4f76db026ef07c4744fe52
7
+ data.tar.gz: 7550880a0a82da99734d38178c5aa47a1909b1787f2070bbf960f2b70ea177a3dd330484428b220de10d3d511a93b7f87a736dfbaf5c47bd12c50f547da15858
@@ -31,6 +31,7 @@ module RubyLsp
31
31
  # parent ends, the spring process ends as well. If this is not set, Spring will throw an error while trying to
32
32
  # set its own session ID
33
33
  begin
34
+ Process.setpgrp
34
35
  Process.setsid
35
36
  rescue Errno::EPERM
36
37
  # If we can't set the session ID, continue
@@ -52,6 +53,16 @@ module RubyLsp
52
53
  warn("Ruby LSP Rails booting server")
53
54
  read_response
54
55
  warn("Finished booting Ruby LSP Rails server")
56
+
57
+ unless ENV["RAILS_ENV"] == "test"
58
+ at_exit do
59
+ if @wait_thread.alive?
60
+ warn("Ruby LSP Rails is force killing the server")
61
+ sleep(0.5) # give the server a bit of time if we already issued a shutdown notification
62
+ Process.kill(T.must(Signal.list["TERM"]), @wait_thread.pid)
63
+ end
64
+ end
65
+ end
55
66
  rescue Errno::EPIPE, IncompleteMessageError
56
67
  raise InitializationError, @stderr.read
57
68
  end
@@ -66,8 +77,9 @@ module RubyLsp
66
77
 
67
78
  sig { void }
68
79
  def shutdown
69
- send_notification("shutdown")
70
- Thread.pass while @wait_thread.alive?
80
+ warn("Ruby LSP Rails shutting down server")
81
+ send_message("shutdown")
82
+ sleep(0.5) # give the server a bit of time to shutdown
71
83
  [@stdin, @stdout, @stderr].each(&:close)
72
84
  end
73
85
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module Rails
6
- VERSION = "0.3.1"
6
+ VERSION = "0.3.2"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-23 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack