Skip to content

Commit

Permalink
Explicitly display handled errors in Output pane
Browse files Browse the repository at this point in the history
  • Loading branch information
paracycle committed Aug 31, 2022
1 parent 26b787f commit 0bc4b6f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/ruby_lsp/requests/support/rubocop_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def run(path, contents)
@offenses = []
@options[:stdin] = contents
capture_output { super([path]) }
display_handled_errors
end

sig { returns(String) }
Expand All @@ -48,6 +49,16 @@ def formatted_source

private

sig { void }
def display_handled_errors
return if errors.empty?

$stderr.puts "[RuboCop] Encountered and handled errors:"
errors.uniq.each do |error|
$stderr.puts "[RuboCop] - #{error}"
end
end

sig { params(_file: String, offenses: T::Array[RuboCop::Cop::Offense]).void }
def file_finished(_file, offenses)
@offenses = offenses
Expand Down

0 comments on commit 0bc4b6f

Please sign in to comment.