From 849d8bbca5c5b2ebbe46252c84c39558e1dd1da7 Mon Sep 17 00:00:00 2001 From: Manuel Fittko Date: Mon, 4 Nov 2024 16:58:22 +0100 Subject: [PATCH] remove newlines --- rdjson_formatter/rdjson_formatter.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rdjson_formatter/rdjson_formatter.rb b/rdjson_formatter/rdjson_formatter.rb index 9c6a6f3..0ff217b 100644 --- a/rdjson_formatter/rdjson_formatter.rb +++ b/rdjson_formatter/rdjson_formatter.rb @@ -93,13 +93,11 @@ def build_suggestions(offense) return [] unless offense.correctable? && offense.corrector source_buffer = offense.location.source_buffer - corrections = offense.corrector.as_replacements return [] if corrections.empty? min_begin_pos = corrections.map { |range, _| range.begin_pos }.min max_end_pos = corrections.map { |range, _| range.end_pos }.max - merged_range = Parser::Source::Range.new(source_buffer, min_begin_pos, max_end_pos) corrected_text = '' @@ -111,9 +109,7 @@ def build_suggestions(offense) next if range.end_pos <= min_begin_pos || range.begin_pos >= max_end_pos corrected_text += source_buffer.source[current_pos...range.begin_pos] if current_pos < range.begin_pos - corrected_text += replacement_text - current_pos = range.end_pos end