diff --git a/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb b/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb index 427136e8..011755ec 100644 --- a/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb +++ b/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb @@ -172,6 +172,8 @@ def send_message(request, params = nil) json = message.to_json @stdin.write("Content-Length: #{json.length}\r\n\r\n", json) + rescue Errno::EPIPE + # The server connection died end alias_method :send_notification, :send_message @@ -193,6 +195,9 @@ def read_response end response.fetch(:result) + rescue Errno::EPIPE + # The server connection died + nil end end