Skip to content

Commit f78c468

Browse files
committed
Eager load routes if necessary
1 parent 23edfb1 commit f78c468

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ruby_lsp/ruby_lsp_rails/server.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
# NOTE: We should avoid printing to stderr since it causes problems. We never read the standard error pipe from the
77
# client, so it will become full and eventually hang or crash. Instead, return a response with an `error` key.
88

9+
# Load routes if they haven't been loaded yet (see https://github.com/rails/rails/pull/51614).
10+
routes_reloader = Rails.application.routes_reloader
11+
routes_reloader.execute_unless_loaded if routes_reloader&.respond_to?(:execute_unless_loaded)
12+
913
module RubyLsp
1014
module Rails
1115
class Server

0 commit comments

Comments
 (0)