Skip to content

Commit abb4660

Browse files
chore(tool_output): group none-returning tool operations for readability (#2146)
1 parent 8f8e35b commit abb4660

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

crates/forge_app/src/fmt/fmt_output.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ use crate::utils::format_display_path;
88
impl FormatContent for ToolOperation {
99
fn to_content(&self, env: &Environment) -> Option<ChatResponseContent> {
1010
match self {
11-
ToolOperation::FsRead { input: _, output: _ } => None,
12-
ToolOperation::ImageRead { output: _ } => None,
1311
ToolOperation::FsCreate { input, output } => {
1412
if let Some(ref before) = output.before {
1513
let after = &input.content;
@@ -20,26 +18,28 @@ impl FormatContent for ToolOperation {
2018
None
2119
}
2220
}
23-
ToolOperation::FsRemove { input: _, output: _ } => None,
24-
ToolOperation::FsSearch { input: _, output: _ } => None,
25-
ToolOperation::CodebaseSearch { output: _ } => None,
2621
ToolOperation::FsPatch { input: _, output } => Some(ChatResponseContent::PlainText(
2722
DiffFormat::format(&output.before, &output.after)
2823
.diff()
2924
.to_string(),
3025
)),
31-
ToolOperation::FsUndo { input: _, output: _ } => None,
32-
ToolOperation::NetFetch { input: _, output: _ } => None,
33-
ToolOperation::Shell { output: _ } => None,
34-
ToolOperation::FollowUp { output: _ } => None,
3526
ToolOperation::PlanCreate { input: _, output } => Some({
3627
let title = TitleFormat::debug(format!(
3728
"Create {}",
3829
format_display_path(&output.path, &env.cwd)
3930
));
4031
title.into()
4132
}),
42-
ToolOperation::Skill { input: _, output: _ } => None,
33+
ToolOperation::FsRead { input: _, output: _ }
34+
| ToolOperation::ImageRead { output: _ }
35+
| ToolOperation::FsRemove { input: _, output: _ }
36+
| ToolOperation::FsSearch { input: _, output: _ }
37+
| ToolOperation::CodebaseSearch { output: _ }
38+
| ToolOperation::FsUndo { input: _, output: _ }
39+
| ToolOperation::NetFetch { input: _, output: _ }
40+
| ToolOperation::Shell { output: _ }
41+
| ToolOperation::FollowUp { output: _ }
42+
| ToolOperation::Skill { input: _, output: _ } => None,
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)