Skip to content

Commit

Permalink
Revert "Use notify instead of manual notification"
Browse files Browse the repository at this point in the history
This reverts commit a0b9bf5.
  • Loading branch information
RemcoSmitsDev committed Jan 22, 2025
1 parent 8ba15ae commit 898e613
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 11 additions & 1 deletion crates/project/src/dap_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,17 @@ impl DapStore {
cx.spawn(|this, mut cx| async move {
let session = cx.new_model(|_| DebugSession::new_local(session_id, config))?;

let client = start_client_task.await?;
let client = match start_client_task.await {
Ok(client) => client,
Err(error) => {
this.update(&mut cx, |_, cx| {
cx.emit(DapStoreEvent::Notification(error.to_string()));
})
.log_err();

return Err(error);
}
};

this.update(&mut cx, |store, cx| {
session.update(cx, |session, cx| {
Expand Down
8 changes: 3 additions & 5 deletions crates/tasks_ui/src/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ use ui::{
WindowContext,
};
use util::ResultExt;
use workspace::{
notifications::NotifyTaskExt, tasks::schedule_resolved_task, ModalView, Workspace,
};
use workspace::{tasks::schedule_resolved_task, ModalView, Workspace};
pub use zed_actions::{Rerun, Spawn};

/// A modal used to spawn new tasks.
Expand Down Expand Up @@ -323,7 +321,7 @@ impl PickerDelegate for TasksModalDelegate {
workspace.project().update(cx, |project, cx| {
project
.start_debug_session(debug_config, cx)
.detach_and_notify_err(cx);
.detach_and_log_err(cx);
})
}
};
Expand Down Expand Up @@ -487,7 +485,7 @@ impl PickerDelegate for TasksModalDelegate {
workspace.project().update(cx, |project, cx| {
project
.start_debug_session(debug_config, cx)
.detach_and_notify_err(cx);
.detach_and_log_err(cx);
})
}
};
Expand Down

0 comments on commit 898e613

Please sign in to comment.