ruby-lsp-rails 0.3.29 → 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: 43674ae4350b5f31cbc9acc5abdc9fb2dc14aff416980cbec4649277026ff4d2
4
- data.tar.gz: 1d5a71a935b3845ea69a9a97cf1d0ce19fee59ac32779460d91d27d269c24b86
3
+ metadata.gz: 49634ac9d3fa4dd22f14f87ba41520ac0edbdee999157a46b354c1c6da36b855
4
+ data.tar.gz: 462413c2420e98671bee2aaadd5bb843e6b209a011fd375f6ef59f871cbb75d1
5
5
  SHA512:
6
- metadata.gz: d4c615aac96f68ebe1fc5f4111f7ba4eef7161c1a7c006d807ddc69c9fb487b8d2cd23f0ac9144caf51426e20f72a452cd7f955ee41038126252440504b38f76
7
- data.tar.gz: 85b028df166f13e96081ff97ea8bec5e91fc4e02380bdcb09476f662edf0d128c029247c9db18cebbfd10671eed33176c2fcb60804f8f180b6ab3c9e2d4d02c9
6
+ metadata.gz: 83f71eb4c8622c3652b561e0c5f4a4d3fa9de34b853e6fa5877435256b12b580c08a10ff8b1593d0224c48c0f9fec2ea633e4bdc9d6c2ae45cb292f6e681f67b
7
+ data.tar.gz: f4c7425425794e1e1b2cd3a24a5283397b702837a6383a2a617f3cffe97495b5afae44c0a96f6806ad17452c67bf6b2bd8aed84c23d6cab0b596f52ef3ee6fc7
@@ -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.29"
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.29
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-10 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