zed/crates/debugger_ui/src
Om Chillure d06406f7d8
Fix debugger start ignoring save property (#53353)
## Summary

When `debugger::Start` runs a build task (via the `"build"` field in
`debug.json`), it was bypassing the task's `"save"` property and calling
`project.create_terminal_task()` directly. This meant unsaved files were
never saved before the build ran, even when `"save": "all"` was set
unlike `task: spawn` which correctly saved first.

**Changes:**
- Extracted `Workspace::save_for_task(workspace, strategy, cx)` as a
shared async helper in `workspace/src/tasks.rs`
- Refactored `schedule_resolved_task` to call this helper (no behavior
change, removes inline duplication)
- Called the same helper in `RunningState::resolve_scenario` before
`create_terminal_task`, so the debugger build path now respects the
task's `save` strategy
- Added `test_save_for_task_all`, `test_save_for_task_current`, and
`test_save_for_task_none` tests covering the extracted helper directly

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53284

## Video after fix

[Screencast from 2026-04-08
08-04-18.webm](https://github.com/user-attachments/assets/b0c20164-3670-440a-b43a-8457fb57bfbd)



## Release Notes:

- Fixed debugger not saving files before running a build task when
`"save": "all"` is set in the task definition
2026-04-21 19:25:21 +00:00
..
session Fix debugger start ignoring save property (#53353) 2026-04-21 19:25:21 +00:00
tests workspace: Add separate "format and save" action (#53710) 2026-04-14 16:20:05 +01:00
attach_modal.rs
debugger_panel.rs gpui: Improve Anchored to support center position (#47154) 2026-04-21 09:01:42 +00:00
debugger_ui.rs Require multibuffer excerpts to be ordered and nonoverlapping (#52364) 2026-04-01 17:25:32 +00:00
dropdown_menus.rs gpui: Improve Anchored to support center position (#47154) 2026-04-21 09:01:42 +00:00
new_process_modal.rs gpui: Improve Anchored to support center position (#47154) 2026-04-21 09:01:42 +00:00
persistence.rs Fix shared database test isolation (#51809) 2026-03-18 12:05:57 -07:00
session.rs Start removing callers of legacy excerpt APIs (#50144) 2026-02-26 10:37:43 -05:00
tests.rs theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00