chore: Remove outline dependency from breadcrumbs (#22504)

This slashes our incremental dev times (touch editor) by 0.6s
(8.1->7.6s) due to unblocking terminal_view build sooner.

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-12-30 13:08:26 +01:00 committed by GitHub
parent 5f4f3a9c87
commit 3f33ca01a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 43 additions and 16 deletions

View file

@ -102,8 +102,11 @@ impl Render for Breadcrumbs {
.on_click({
let editor = editor.clone();
move |_, cx| {
if let Some(editor) = editor.upgrade() {
outline::toggle(editor, &editor::actions::ToggleOutline, cx)
if let Some((editor, callback)) = editor
.upgrade()
.zip(zed_actions::outline::TOGGLE_OUTLINE.get())
{
callback(editor.to_any(), cx);
}
}
})
@ -112,14 +115,14 @@ impl Render for Breadcrumbs {
let focus_handle = editor.read(cx).focus_handle(cx);
Tooltip::for_action_in(
"Show Symbol Outline",
&editor::actions::ToggleOutline,
&zed_actions::outline::ToggleOutline,
&focus_handle,
cx,
)
} else {
Tooltip::for_action(
"Show Symbol Outline",
&editor::actions::ToggleOutline,
&zed_actions::outline::ToggleOutline,
cx,
)
}