From 653a322c2c56e3ec937f27784bd28e50802bbbe1 Mon Sep 17 00:00:00 2001 From: Chris AtLee Date: Wed, 21 Jun 2023 10:46:38 -0400 Subject: [PATCH] Catch LoadError exceptions from formatting calls Rubocop will raise a `LoadError` when it can't resolve requirements listed in `.rubocop.yml`. Currently these exceptions are missed, and formatting silently fails. --- lib/ruby_lsp/executor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ruby_lsp/executor.rb b/lib/ruby_lsp/executor.rb index c5cb950ae3..a94d9561eb 100644 --- a/lib/ruby_lsp/executor.rb +++ b/lib/ruby_lsp/executor.rb @@ -130,7 +130,7 @@ def run(request) ) nil - rescue StandardError => error + rescue StandardError, LoadError => error @message_queue << Notification.new( message: "window/showMessage", params: Interface::ShowMessageParams.new( @@ -156,7 +156,7 @@ def run(request) when "textDocument/diagnostic" begin diagnostic(uri) - rescue StandardError => error + rescue StandardError, LoadError => error @message_queue << Notification.new( message: "window/showMessage", params: Interface::ShowMessageParams.new(