context servers: Show configuration modal when extension is installed (#29309)
WIP Release Notes: - N/A --------- Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com> Co-authored-by: Marshall Bowers <git@maxdeviant.com> Co-authored-by: Cole Miller <m@cole-miller.net> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
This commit is contained in:
parent
bffa53d706
commit
24eb039752
35 changed files with 1866 additions and 437 deletions
|
@ -431,6 +431,13 @@ impl ExtensionStore {
|
|||
.filter_map(|extension| extension.dev.then_some(&extension.manifest))
|
||||
}
|
||||
|
||||
pub fn extension_manifest_for_id(&self, extension_id: &str) -> Option<&Arc<ExtensionManifest>> {
|
||||
self.extension_index
|
||||
.extensions
|
||||
.get(extension_id)
|
||||
.map(|extension| &extension.manifest)
|
||||
}
|
||||
|
||||
/// Returns the names of themes provided by extensions.
|
||||
pub fn extension_themes<'a>(
|
||||
&'a self,
|
||||
|
@ -744,8 +751,18 @@ impl ExtensionStore {
|
|||
.await;
|
||||
|
||||
if let ExtensionOperation::Install = operation {
|
||||
this.update( cx, |_, cx| {
|
||||
cx.emit(Event::ExtensionInstalled(extension_id));
|
||||
this.update( cx, |this, cx| {
|
||||
cx.emit(Event::ExtensionInstalled(extension_id.clone()));
|
||||
if let Some(events) = ExtensionEvents::try_global(cx) {
|
||||
if let Some(manifest) = this.extension_manifest_for_id(&extension_id) {
|
||||
events.update(cx, |this, cx| {
|
||||
this.emit(
|
||||
extension::Event::ExtensionInstalled(manifest.clone()),
|
||||
cx,
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
|
@ -935,6 +952,17 @@ impl ExtensionStore {
|
|||
.await?;
|
||||
|
||||
this.update(cx, |this, cx| this.reload(None, cx))?.await;
|
||||
this.update(cx, |this, cx| {
|
||||
cx.emit(Event::ExtensionInstalled(extension_id.clone()));
|
||||
if let Some(events) = ExtensionEvents::try_global(cx) {
|
||||
if let Some(manifest) = this.extension_manifest_for_id(&extension_id) {
|
||||
events.update(cx, |this, cx| {
|
||||
this.emit(extension::Event::ExtensionInstalled(manifest.clone()), cx)
|
||||
});
|
||||
}
|
||||
}
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue