1mod context;
2mod context_editor;
3mod context_history;
4mod context_store;
5mod patch;
6mod slash_command;
7mod slash_command_picker;
8
9use std::sync::Arc;
10
11use client::Client;
12use gpui::{App, Context};
13use workspace::Workspace;
14
15pub use crate::context::*;
16pub use crate::context_editor::*;
17pub use crate::context_history::*;
18pub use crate::context_store::*;
19pub use crate::patch::*;
20pub use crate::slash_command::*;
21
22pub fn init(client: Arc<Client>, cx: &mut App) {
23 context_store::init(&client.into());
24 workspace::FollowableViewRegistry::register::<ContextEditor>(cx);
25
26 cx.observe_new(
27 |workspace: &mut Workspace, _window, _cx: &mut Context<Workspace>| {
28 workspace
29 .register_action(ContextEditor::quote_selection)
30 .register_action(ContextEditor::insert_selection)
31 .register_action(ContextEditor::copy_code)
32 .register_action(ContextEditor::handle_insert_dragged_files);
33 },
34 )
35 .detach();
36}