From eff09b03847e98c370442961e767f861795cf4b7 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Wed, 23 Jul 2025 13:22:51 +0200 Subject: [PATCH] Remove ToolCallConfirmation --- crates/acp_thread/src/acp_thread.rs | 77 ----------------------------- 1 file changed, 77 deletions(-) diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs index efea78c666b6194cefb04ae3f6a5a8ed77895c6c..7cd6ad7580c3061c88d55b7bd04083561d4cd7c8 100644 --- a/crates/acp_thread/src/acp_thread.rs +++ b/crates/acp_thread/src/acp_thread.rs @@ -250,83 +250,6 @@ impl Display for ToolCallStatus { } } -#[derive(Debug)] -pub enum ToolCallConfirmation { - Edit { - description: Option>, - }, - Execute { - command: String, - root_command: String, - description: Option>, - }, - Mcp { - server_name: String, - tool_name: String, - tool_display_name: String, - description: Option>, - }, - Fetch { - urls: Vec, - description: Option>, - }, - Other { - description: Entity, - }, -} - -impl ToolCallConfirmation { - pub fn from_acp( - confirmation: acp_old::ToolCallConfirmation, - language_registry: Arc, - cx: &mut App, - ) -> Self { - let to_md = |description: String, cx: &mut App| -> Entity { - cx.new(|cx| { - Markdown::new( - description.into(), - Some(language_registry.clone()), - None, - cx, - ) - }) - }; - - match confirmation { - acp_old::ToolCallConfirmation::Edit { description } => Self::Edit { - description: description.map(|description| to_md(description, cx)), - }, - acp_old::ToolCallConfirmation::Execute { - command, - root_command, - description, - } => Self::Execute { - command, - root_command, - description: description.map(|description| to_md(description, cx)), - }, - acp_old::ToolCallConfirmation::Mcp { - server_name, - tool_name, - tool_display_name, - description, - } => Self::Mcp { - server_name, - tool_name, - tool_display_name, - description: description.map(|description| to_md(description, cx)), - }, - acp_old::ToolCallConfirmation::Fetch { urls, description } => Self::Fetch { - urls: urls.iter().map(|url| url.into()).collect(), - description: description.map(|description| to_md(description, cx)), - }, - acp_old::ToolCallConfirmation::Other { description } => Self::Other { - description: to_md(description, cx), - }, - } - } -} - #[derive(Debug, PartialEq, Clone)] enum ContentBlock { Empty,