extension: Add ExtensionEvents for listening to extension-related events (#26562)

This PR adds a new `ExtensionEvents` event bus that can be used to
listen for extension-related events throughout the app.

Today you need to have a handle to the `ExtensionStore` (which entails
depending on `extension_host`) in order to listen for extension events.

With this change subscribers only need to depend on `extension`, which
has a leaner dependency graph.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-12 13:01:52 -04:00 committed by GitHub
parent ffcd023f83
commit acf9b22466
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 57 additions and 8 deletions

View file

@ -1,4 +1,5 @@
pub mod extension_builder;
mod extension_events;
mod extension_host_proxy;
mod extension_manifest;
mod types;
@ -14,12 +15,14 @@ use gpui::{App, Task};
use language::LanguageName;
use semantic_version::SemanticVersion;
pub use crate::extension_events::*;
pub use crate::extension_host_proxy::*;
pub use crate::extension_manifest::*;
pub use crate::types::*;
/// Initializes the `extension` crate.
pub fn init(cx: &mut App) {
extension_events::init(cx);
ExtensionHostProxy::default_global(cx);
}