refactor: Consolidate item content filtering into a single filter string

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-02 18:54:50 -03:00
parent d7a0ac96b3
commit 61d7dcb94e
3 changed files with 38 additions and 58 deletions

View File

@@ -139,19 +139,11 @@ impl ItemService {
&self,
conn: &Connection,
id: i64,
head_bytes: Option<usize>,
head_words: Option<usize>,
head_lines: Option<usize>,
tail_bytes: Option<usize>,
tail_words: Option<usize>,
tail_lines: Option<usize>,
line_start: Option<usize>,
line_end: Option<usize>,
grep: Option<String>,
filter: Option<String>,
) -> Result<(Vec<u8>, String, bool), CoreError> {
// Use streaming approach to handle all filtering options consistently
let (mut reader, mime_type, is_binary) = self.get_item_content_info_streaming(
conn, id, None
conn, id, filter
)?;
// Read all the filtered content into a buffer