
This PR overhauls extension registration in order to make it more modular. The `extension` crate now contains an `ExtensionHostProxy` that can be used to register various proxies that the extension host can use to interact with the rest of the system. There are now a number of different proxy traits representing the various pieces of functionality that can be provided by an extension. The respective crates that provide this functionality can implement their corresponding proxy trait in order to register a proxy that the extension host will use to register the bits of functionality provided by the extension. Release Notes: - N/A
28 lines
778 B
Rust
28 lines
778 B
Rust
pub mod client;
|
|
mod extension_context_server;
|
|
pub mod manager;
|
|
pub mod protocol;
|
|
mod registry;
|
|
pub mod types;
|
|
|
|
use command_palette_hooks::CommandPaletteFilter;
|
|
use gpui::{actions, AppContext};
|
|
use settings::Settings;
|
|
|
|
use crate::manager::ContextServerSettings;
|
|
pub use crate::registry::ContextServerFactoryRegistry;
|
|
|
|
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);
|
|
ContextServerFactoryRegistry::default_global(cx);
|
|
extension_context_server::init(cx);
|
|
|
|
CommandPaletteFilter::update_global(cx, |filter, _cx| {
|
|
filter.hide_namespace(CONTEXT_SERVERS_NAMESPACE);
|
|
});
|
|
}
|