Headless extensions (#14538)

Release Notes:

- remoting (alpha only): Fix extension installation
This commit is contained in:
Conrad Irwin 2024-07-16 00:08:56 -06:00 committed by GitHub
parent e68d9f4625
commit e413823ae7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 26 deletions

View file

@ -1,6 +1,7 @@
use anyhow::{anyhow, Result};
use client::DevServerProjectId;
use client::{user::UserStore, Client, ClientSettings};
use extension::ExtensionStore;
use fs::Fs;
use futures::Future;
use gpui::{AppContext, AsyncAppContext, Context, Global, Model, ModelContext, Task, WeakModel};
@ -9,7 +10,7 @@ use node_runtime::NodeRuntime;
use postage::stream::Stream;
use project::Project;
use rpc::{proto, ErrorCode, TypedEnvelope};
use settings::Settings;
use settings::{Settings, SettingsStore};
use std::{collections::HashMap, sync::Arc};
use util::{ResultExt, TryFutureExt};
@ -83,6 +84,11 @@ impl DevServer {
move |this, cx| Self::maintain_connection(this, client.clone(), cx).log_err()
});
cx.observe_global::<SettingsStore>(|_, cx| {
ExtensionStore::global(cx).update(cx, |store, cx| store.auto_install_extensions(cx))
})
.detach();
DevServer {
_subscriptions: vec![
client.add_message_handler(cx.weak_model(), Self::handle_dev_server_instructions),