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.

debugger: Clear dap status indicator when dap update/download is complete (#28913)

Anthony Eid19f542b8d60f
diff --git a/crates/dap/src/adapters.rs b/crates/dap/src/adapters.rs
index 12a814b5ab6..75e8a3814ff 100644
--- a/crates/dap/src/adapters.rs
+++ b/crates/dap/src/adapters.rs
@@ -1,5 +1,5 @@
use ::fs::Fs;
-use anyhow::{Context as _, Ok, Result, anyhow};
+use anyhow::{Context as _, Result, anyhow};
use async_compression::futures::bufread::GzipDecoder;
use async_tar::Archive;
use async_trait::async_trait;
@@ -256,7 +256,21 @@ pub trait DebugAdapter: 'static + Send + Sync {
self.name()
);
delegate.update_status(self.name(), DapStatus::Downloading);
- self.install_binary(version, delegate).await?;
+ match self.install_binary(version, delegate).await {
+ Ok(_) => {
+ delegate.update_status(self.name(), DapStatus::None);
+ }
+ Err(error) => {
+ delegate.update_status(
+ self.name(),
+ DapStatus::Failed {
+ error: error.to_string(),
+ },
+ );
+
+ return Err(error);
+ }
+ }
delegate
.updated_adapters()