Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Improve error message around failing to install dev extensions (#30711)

Ben Kunkle83498ebf2b86
diff --git a/Cargo.lock b/Cargo.lock
index 511f389955f..0b8299c94e3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5161,6 +5161,7 @@ dependencies = [
"fuzzy",
"gpui",
"language",
+ "log",
"num-format",
"picker",
"project",
diff --git a/crates/extensions_ui/Cargo.toml b/crates/extensions_ui/Cargo.toml
index bc68c98ebc1..c31483d763d 100644
--- a/crates/extensions_ui/Cargo.toml
+++ b/crates/extensions_ui/Cargo.toml
@@ -23,6 +23,7 @@ fs.workspace = true
fuzzy.workspace = true
gpui.workspace = true
language.workspace = true
+log.workspace = true
num-format.workspace = true
picker.workspace = true
project.workspace = true
@@ -37,9 +38,9 @@ theme.workspace = true
ui.workspace = true
util.workspace = true
vim_mode_setting.workspace = true
+workspace-hack.workspace = true
workspace.workspace = true
zed_actions.workspace = true
-workspace-hack.workspace = true
[dev-dependencies]
editor = { workspace = true, features = ["test-support"] }
diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs
index 03836873047..792d3087641 100644
--- a/crates/extensions_ui/src/extensions_ui.rs
+++ b/crates/extensions_ui/src/extensions_ui.rs
@@ -132,10 +132,13 @@ pub fn init(cx: &mut App) {
match install_task.await {
Ok(_) => {}
Err(err) => {
+ log::error!("Failed to install dev extension: {:?}", err);
workspace_handle
.update(cx, |workspace, cx| {
workspace.show_error(
- &err.context("failed to install dev extension"),
+ // NOTE: using `anyhow::context` here ends up not printing
+ // the error
+ &format!("Failed to install dev extension: {}", err),
cx,
);
})