zed/crates/debugger_ui
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
..
src Fix debugger start ignoring save property (#53353) 2026-04-21 19:25:21 +00:00
Cargo.toml theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
LICENSE-GPL Debugger implementation (#13433) 2025-03-18 12:55:25 -04:00