From e71012a2f81b87610a73e195304050a5364a3c5e Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Fri, 12 Sep 2025 22:48:24 +0200 Subject: [PATCH] Automatically uninstall release extension prior to dev extension install (#38088) Closes https://github.com/zed-industries/zed/issues/31106 This fixes an issue where you would have to manually uninstall the release extension before installing the dev extension in case that is locally installed. Release Notes: - Installing a dev extension will now automatically remove the release extension should it be installed. --- crates/extension_host/src/extension_host.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/extension_host/src/extension_host.rs b/crates/extension_host/src/extension_host.rs index e6c0c128f90c0138e3fe574390231ced882ff959..2d5839e96a1cf5c7550300e762bb97d357864fc6 100644 --- a/crates/extension_host/src/extension_host.rs +++ b/crates/extension_host/src/extension_host.rs @@ -938,6 +938,20 @@ impl ExtensionStore { ExtensionManifest::load(fs.clone(), &extension_source_path).await?; let extension_id = extension_manifest.id.clone(); + if let Some(uninstall_task) = this + .update(cx, |this, cx| { + this.extension_index + .extensions + .get(extension_id.as_ref()) + .is_some_and(|index_entry| !index_entry.dev) + .then(|| this.uninstall_extension(extension_id.clone(), cx)) + }) + .ok() + .flatten() + { + uninstall_task.await.log_err(); + } + if !this.update(cx, |this, cx| { match this.outstanding_operations.entry(extension_id.clone()) { btree_map::Entry::Occupied(_) => return false, @@ -986,7 +1000,7 @@ impl ExtensionStore { ) .await?; } else { - bail!("extension {extension_id} is already installed"); + bail!("extension {extension_id} is still installed"); } }