ruby-lsp-rails 0.3.28 → 0.3.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 231b488bf88047c642f2556980d6c0ce96edbeafbf2ded65a4104515584a5100
4
- data.tar.gz: 207b91a283859f74804b4e825d4ca71ee645b0f73ac84e5d7e7348b382bf2745
3
+ metadata.gz: 49634ac9d3fa4dd22f14f87ba41520ac0edbdee999157a46b354c1c6da36b855
4
+ data.tar.gz: 462413c2420e98671bee2aaadd5bb843e6b209a011fd375f6ef59f871cbb75d1
5
5
  SHA512:
6
- metadata.gz: 8ef4e5363a31a1821da8d43738c5049239e827d609ffa8c8214f9e8fae148739770614a4f06af082da98a755bfd3522426560936d1ac57f0c14092ace8ced86b
7
- data.tar.gz: 348fab1dc3ada6a6a2672c4c9b54e0ae0f67f2f056023929af7c76dac5d66583c32c9fbdcc1347fc3913cb59a3e30ae7e495977b762228aad6a52f502254a930
6
+ metadata.gz: 83f71eb4c8622c3652b561e0c5f4a4d3fa9de34b853e6fa5877435256b12b580c08a10ff8b1593d0224c48c0f9fec2ea633e4bdc9d6c2ae45cb292f6e681f67b
7
+ data.tar.gz: f4c7425425794e1e1b2cd3a24a5283397b702837a6383a2a617f3cffe97495b5afae44c0a96f6806ad17452c67bf6b2bd8aed84c23d6cab0b596f52ef3ee6fc7
@@ -105,6 +105,8 @@ module RubyLsp
105
105
  while (content = @stderr.gets("\n"))
106
106
  log_message(content, type: RubyLsp::Constant::MessageType::LOG)
107
107
  end
108
+ rescue IOError
109
+ # The server was shutdown and stderr is already closed
108
110
  end,
109
111
  Thread,
110
112
  )
@@ -4,9 +4,6 @@
4
4
  require "json"
5
5
  require "open3"
6
6
 
7
- # NOTE: We should avoid printing to stderr since it causes problems. We never read the standard error pipe from the
8
- # client, so it will become full and eventually hang or crash. Instead, return a response with an `error` key.
9
-
10
7
  module RubyLsp
11
8
  module Rails
12
9
  module Common
@@ -125,6 +122,7 @@ module RubyLsp
125
122
 
126
123
  def start
127
124
  load_routes
125
+ clear_file_system_resolver_hooks
128
126
  send_result({ message: "ok", root: ::Rails.root.to_s })
129
127
 
130
128
  while @running
@@ -302,6 +300,18 @@ module RubyLsp
302
300
  routes_reloader.execute_unless_loaded if routes_reloader&.respond_to?(:execute_unless_loaded)
303
301
  end
304
302
  end
303
+
304
+ # File system resolver hooks spawn file watcher threads which introduce unnecessary overhead since the LSP already
305
+ # watches files. Since the Rails application is already booted by the time we reach this script, we can't no-op
306
+ # the file watcher implementation. Instead, we clear the hooks to prevent the registered file watchers from being
307
+ # instantiated
308
+ def clear_file_system_resolver_hooks
309
+ return unless defined?(::ActionView::PathRegistry)
310
+
311
+ with_notification_error_handling("clear_file_system_resolver_hooks") do
312
+ ::ActionView::PathRegistry.file_system_resolver_hooks.clear
313
+ end
314
+ end
305
315
  end
306
316
  end
307
317
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module Rails
6
- VERSION = "0.3.28"
6
+ VERSION = "0.3.30"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.28
4
+ version: 0.3.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-07 00:00:00.000000000 Z
10
+ date: 2025-01-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ruby-lsp