Files
zed/crates/debugger_ui
Parker Loflin 0c5af8c563 Remove dead code and redundant checks in git, debugger, and panel UIs (#67149)
## Summary

Removes unused code and redundant work. No behavior changes.

- Diagnostics no longer clones the buffer snapshot for every row it
scans when expanding context. The callee takes a reference.
- The project panel's download path no longer calls the blocking
`Path::exists` before `Fs::create_dir`, which already succeeds when the
directory exists.
- Removes `cx.notify()` calls right after callees that already notify:
`update_visible_entries`, `Picker::update_matches`, `Picker::refresh`,
`set_selected_index` and `Pane::set_zoomed`.
- Calls `select_thread` directly. It already returns early for the
current thread.
- Replaces `collect::<Vec<_>>().len()` with `count()` and
`Some(i).and_then(f)` with `f(i)`.
- Drops clones made only to be borrowed, `.peekable()` calls that never
peek, and `let _ =` on unit values.
- Removes unused code:
  - four `git::repository` helpers
- `open_branches` and `open_stash`, which were never registered as
action handlers
  - `ProjectDiff::deploy_at_project_path`
  - `RepositorySelector::update_repository_entries`
  - `ProjectSymbols`
- the git graph's never-read `SplitState::left_ratio`. Its `on_drop`
handler stays, empty, so the drop still ends the drag.
- `open_path_prompt`: narrows `cfg(any(test, feature = "test-support"))`
to `cfg(test)`. The crate has no `test-support` feature.

## Testing

- `./script/clippy`
- `cargo test -p git -p git_ui -p debugger_ui -p tasks_ui -p diagnostics
-p project_panel`

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-11-19 12:46:48 +00:00
..