This PR reworks how the Assistant Panel references slash commands, context servers, and tools. Previously we were always reading them from the global registries, but now we store individual collections on each Assistant Panel instance so that there can be different ones registered for each project. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev> Co-authored-by: Antonio <antonio@zed.dev> Co-authored-by: Joseph <joseph@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
24 lines
585 B
Rust
24 lines
585 B
Rust
use command_palette_hooks::CommandPaletteFilter;
|
|
use gpui::{actions, AppContext};
|
|
use settings::Settings;
|
|
|
|
use crate::manager::ContextServerSettings;
|
|
|
|
pub mod client;
|
|
pub mod manager;
|
|
pub mod protocol;
|
|
pub mod types;
|
|
|
|
actions!(context_servers, [Restart]);
|
|
|
|
/// The namespace for the context servers actions.
|
|
pub const CONTEXT_SERVERS_NAMESPACE: &'static str = "context_servers";
|
|
|
|
pub fn init(cx: &mut AppContext) {
|
|
ContextServerSettings::register(cx);
|
|
|
|
CommandPaletteFilter::update_global(cx, |filter, _cx| {
|
|
filter.hide_namespace(CONTEXT_SERVERS_NAMESPACE);
|
|
});
|
|
}
|