1mod context;
2mod context_editor;
3mod context_history;
4mod context_store;
5pub mod language_model_selector;
6mod max_mode_tooltip;
7mod slash_command;
8mod slash_command_picker;
9
10use std::sync::Arc;
11
12use client::Client;
13use gpui::{App, Context};
14use workspace::Workspace;
15
16pub use crate::context::*;
17pub use crate::context_editor::*;
18pub use crate::context_history::*;
19pub use crate::context_store::*;
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}