From 6bdbed91177cb6ca6569d9a1f18a5a1d82d0c491 Mon Sep 17 00:00:00 2001 From: Albab-Hasan Date: Wed, 4 Feb 2026 10:04:30 +0600 Subject: [PATCH 1/3] Remove duplicate line_hint assignment in push() --- crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs index 904ec05a8c7565..9abeb2482acf53 100644 --- a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs +++ b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs @@ -50,7 +50,6 @@ impl StreamingFuzzyMatcher { // Add the chunk to our incomplete line buffer self.incomplete_line.push_str(chunk); - self.line_hint = line_hint; if let Some((last_pos, _)) = self.incomplete_line.match_indices('\n').next_back() { let complete_part = &self.incomplete_line[..=last_pos]; From b09f6d346c7070fe11ddd88bcac25d378153c877 Mon Sep 17 00:00:00 2001 From: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:34:31 +0600 Subject: [PATCH 2/3] Simplify line_hint assignment in push method --- crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs index 9abeb2482acf53..d8428844197198 100644 --- a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs +++ b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs @@ -44,13 +44,11 @@ impl StreamingFuzzyMatcher { /// Returns `Some(range)` if a match has been found with the accumulated /// query so far, or `None` if no suitable match exists yet. pub fn push(&mut self, chunk: &str, line_hint: Option) -> Option> { - if line_hint.is_some() { - self.line_hint = line_hint; - } // Add the chunk to our incomplete line buffer self.incomplete_line.push_str(chunk); - + self.line_hint = line_hint; + if let Some((last_pos, _)) = self.incomplete_line.match_indices('\n').next_back() { let complete_part = &self.incomplete_line[..=last_pos]; From b6522d55211106d8f58886db889c086eb4204b42 Mon Sep 17 00:00:00 2001 From: MrSubidubi Date: Mon, 9 Feb 2026 10:33:38 +0100 Subject: [PATCH 3/3] Remove newline and trailing whitespace --- crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs index d8428844197198..641c82b9f2f5da 100644 --- a/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs +++ b/crates/agent/src/edit_agent/streaming_fuzzy_matcher.rs @@ -44,11 +44,10 @@ impl StreamingFuzzyMatcher { /// Returns `Some(range)` if a match has been found with the accumulated /// query so far, or `None` if no suitable match exists yet. pub fn push(&mut self, chunk: &str, line_hint: Option) -> Option> { - // Add the chunk to our incomplete line buffer self.incomplete_line.push_str(chunk); self.line_hint = line_hint; - + if let Some((last_pos, _)) = self.incomplete_line.match_indices('\n').next_back() { let complete_part = &self.incomplete_line[..=last_pos];