diff --git a/crates/assistant_context_editor/src/assistant_context_editor.rs b/crates/assistant_context_editor/src/assistant_context_editor.rs index 8ba3b1bada9134f6402a3ad6c2d9b5cae26b920e..066b325d4ebfc7bbeeae1ca5e0fa5b36672612ee 100644 --- a/crates/assistant_context_editor/src/assistant_context_editor.rs +++ b/crates/assistant_context_editor/src/assistant_context_editor.rs @@ -8,7 +8,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::*; @@ -16,6 +17,18 @@ pub use crate::context_history::*; pub use crate::context_store::*; 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(); }