From ca9a1e58af8f6bf0dee1b51e6780f90226944131 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 9 May 2025 15:59:44 -0400 Subject: [PATCH] assistant_context_editor: Register `ContextEditor` actions that were lost (#30428) This PR restores the `ContextEditor` actions that were lost in https://github.com/zed-industries/zed/pull/30168. Closes https://github.com/zed-industries/zed/issues/30356. Release Notes: - agent: Added back some missing actions, including `assistant: quote selection`. --- .../src/assistant_context_editor.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/assistant_context_editor/src/assistant_context_editor.rs b/crates/assistant_context_editor/src/assistant_context_editor.rs index b399059beb92c7fe856035e45f7f464e222ca590..601d95c55924778384844926fe56a9ec3734a29c 100644 --- a/crates/assistant_context_editor/src/assistant_context_editor.rs +++ b/crates/assistant_context_editor/src/assistant_context_editor.rs @@ -9,7 +9,8 @@ mod slash_command_picker; use std::sync::Arc; use client::Client; -use gpui::App; +use gpui::{App, Context}; +use workspace::Workspace; pub use crate::context::*; pub use crate::context_editor::*; @@ -18,6 +19,18 @@ pub use crate::context_store::*; pub use crate::patch::*; pub use crate::slash_command::*; -pub fn init(client: Arc, _cx: &mut App) { +pub fn init(client: Arc, cx: &mut App) { context_store::init(&client.into()); + workspace::FollowableViewRegistry::register::(cx); + + cx.observe_new( + |workspace: &mut Workspace, _window, _cx: &mut Context| { + workspace + .register_action(ContextEditor::quote_selection) + .register_action(ContextEditor::insert_selection) + .register_action(ContextEditor::copy_code) + .register_action(ContextEditor::handle_insert_dragged_files); + }, + ) + .detach(); }