Files
Sushank Mandal cb73ee1d45 debugger_ui: Enable search in debugger terminal panel (#56863)
When a debug session is running, pressing cmd-f (or using Edit → Find)
in the terminal panel had no effect. Three things were missing:

- The debugger panes never had a BufferSearchBar added to their toolbar,
so there was no search UI to deploy.
- SubView::as_searchable returned None for all item kinds, so even if a
search bar were present it could not find a search target.
- RunningState::render did not wrap its output with the pane search
action handlers, so buffer_search::Deploy was never handled.

Fix all three:
- Register BufferSearchBar on each debugger pane toolbar via the
PaneSearchBarCallbacks global (same pattern as terminal_panel).
- Implement SubView::as_searchable for Terminal kind, delegating to the
inner TerminalView which already implements SearchableItem.
- Wrap RunningState::render with wrap_div_with_search_actions so the
Deploy action reaches the active pane's toolbar.
- Add refresh_terminal_toolbars to re-fire toolbar.set_active_item when
the terminal entity is set, covering the case where the Terminal tab was
already active before the terminal was created. Only refreshes panes
where the Terminal subview is currently the active item.

Add a test that verifies the active debugger pane toolbar has a
BufferSearchBar after a session starts.

Self-Review Checklist:

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

Fixes #38409

Release Notes:

- Fixed `cmd-f` search not working in the debugger terminal panel.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-10-07 22:26:00 +00:00

93 lines
2.5 KiB
TOML

[package]
name = "debugger_ui"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "GPL-3.0-or-later"
[lints]
workspace = true
[lib]
path = "src/debugger_ui.rs"
doctest = false
[features]
test-support = [
"dap/test-support",
"dap_adapters/test-support",
"debugger_tools/test-support",
"editor/test-support",
"gpui/test-support",
"project/test-support",
"util/test-support",
"workspace/test-support",
"unindent",
"dep:command_palette_hooks",
]
[dependencies]
anyhow.workspace = true
bitflags.workspace = true
collections.workspace = true
command_palette_hooks = { workspace = true, optional = true }
dap.workspace = true
dap_adapters = { workspace = true, optional = true }
db.workspace = true
debugger_tools.workspace = true
editor.workspace = true
feature_flags.workspace = true
file_icons.workspace = true
futures.workspace = true
fuzzy.workspace = true
gpui.workspace = true
hex.workspace = true
indoc.workspace = true
itertools.workspace = true
language.workspace = true
log.workspace = true
menu.workspace = true
notifications.workspace = true
parking_lot.workspace = true
parse_int.workspace = true
paths.workspace = true
picker.workspace = true
project.workspace = true
rpc.workspace = true
schemars.workspace = true
search.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_json_lenient.workspace = true
settings.workspace = true
sysinfo.workspace = true
task.workspace = true
tasks_ui.workspace = true
terminal.workspace = true
terminal_view.workspace = true
text.workspace = true
theme.workspace = true
theme_settings.workspace = true
ui.workspace = true
ui_input.workspace = true
unindent = { workspace = true, optional = true }
util.workspace = true
workspace.workspace = true
zed_actions.workspace = true
[dev-dependencies]
command_palette_hooks.workspace = true
dap = { workspace = true, features = ["test-support"] }
dap_adapters = { workspace = true, features = ["test-support"] }
debugger_tools = { workspace = true, features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
language = { workspace = true, features = ["test-support"] }
pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] }
tree-sitter-go.workspace = true
unindent.workspace = true
util = { workspace = true, features = ["test-support"] }
workspace = { workspace = true, features = ["test-support"] }
zlog.workspace = true