debugger_ui: Show a toast when setting breakpoints fails (#28815)

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Cole Miller 2025-04-17 18:10:57 -04:00 committed by GitHub
parent 80a2f71d8e
commit 4095011af5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 101 additions and 32 deletions

View file

@ -1462,7 +1462,7 @@ impl Project {
config: DebugTaskDefinition,
cx: &mut Context<Self>,
) -> Task<Result<Entity<Session>>> {
let Some(worktree) = self.worktrees(cx).next() else {
let Some(worktree) = self.worktrees(cx).find(|tree| tree.read(cx).is_visible()) else {
return Task::ready(Err(anyhow!("Failed to find a worktree")));
};
@ -1501,7 +1501,7 @@ impl Project {
let ret = this
.update(cx, |project, cx| {
project.dap_store.update(cx, |dap_store, cx| {
dap_store.new_session(binary, config, None, cx)
dap_store.new_session(binary, config, worktree.downgrade(), None, cx)
})
})?
.1