From 8a5bba5a66a6bcaa172bfeb4ebfd89adec02b1c8 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 5 Nov 2026 14:49:46 +0900 Subject: [PATCH] Remove outdated heredoc fixup hack --- librubyfmt/src/intermediary.rs | 5 ----- librubyfmt/src/line_tokens.rs | 2 -- librubyfmt/src/render_queue_writer.rs | 16 ---------------- 3 files changed, 23 deletions(-) diff --git a/librubyfmt/src/intermediary.rs b/librubyfmt/src/intermediary.rs index 8f9d0d18..1c95a0a7 100644 --- a/librubyfmt/src/intermediary.rs +++ b/librubyfmt/src/intermediary.rs @@ -34,11 +34,6 @@ impl<'src> Intermediary<'src> { self.tokens.len() } - pub fn fix_heredoc_duplicate_indent_mistake(&mut self) { - // Remove duplicate indent - self.tokens.remove(self.tokens.len() - 3); - } - pub fn last(&self) -> Option<&[ConcreteLineToken<'src>; N]> { self.tokens.last_chunk::() } diff --git a/librubyfmt/src/line_tokens.rs b/librubyfmt/src/line_tokens.rs index d25eb0e5..b55c8043 100644 --- a/librubyfmt/src/line_tokens.rs +++ b/librubyfmt/src/line_tokens.rs @@ -367,8 +367,6 @@ impl<'src> AbstractLineToken<'src> { } out.push(clats_heredoc_close(symbol)); out.push(cltats_hard_newline()); - let indent_depth = if indent != 0 { indent - 2 } else { indent }; - out.push(clats_indent(indent_depth)); } } } diff --git a/librubyfmt/src/render_queue_writer.rs b/librubyfmt/src/render_queue_writer.rs index 6d2ad389..88c9d08a 100644 --- a/librubyfmt/src/render_queue_writer.rs +++ b/librubyfmt/src/render_queue_writer.rs @@ -198,22 +198,6 @@ impl<'src> RenderQueueWriter<'src> { } } } - - if let Some( - [ - ConcreteLineToken::HeredocClose { .. }, - ConcreteLineToken::HardNewLine, - ConcreteLineToken::Indent { .. }, - ConcreteLineToken::Indent { .. }, - ConcreteLineToken::Delim { .. } - | ConcreteLineToken::Dot - | ConcreteLineToken::DirectPart { .. } - | ConcreteLineToken::MethodName { .. }, - ], - ) = accum.last::<5>() - { - accum.fix_heredoc_duplicate_indent_mistake(); - } } }