Skip to content

Commit

Permalink
Fix embarassment of issues
Browse files Browse the repository at this point in the history
* This doesn't work if someone doesn't have RubyLSP installed (duh)
* I didn't spell the RubyLSP class right to begin with

The infinite loop bug that triggered this for me was not my fault tho so that's good
  • Loading branch information
searls committed Oct 3, 2024
1 parent 12283d3 commit 84ee9f4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/standard/lsp/stdin_rubocop_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@ def run(path, contents)

raise Interrupt if aborting?
rescue ::RuboCop::Runner::InfiniteCorrectionLoop => error
raise RubyLsp::Requests::Formatting::Erro, error.message
if defined?(::RubyLsp::Requests::Formatting::Error)
raise ::RubyLsp::Requests::Formatting::Error, error.message
else
raise error
end
rescue ::RuboCop::ValidationError => error
raise ConfigurationError, error.message
rescue => error
raise ::RubyLsp::Requests::Support::InternalRuboCopError, error
if defined?(::RubyLsp::Requests::Formatting::Error)
raise ::RubyLsp::Requests::Support::InternalRuboCopError, error
else
raise error
end
end

def formatted_source
Expand Down

0 comments on commit 84ee9f4

Please sign in to comment.