chore: Make terminal_view own the TerminalSlashCommand (#31070)
This reduces 'touch crates/editor/src/editor.rs && cargo +nightly build'
from 8.9s to 8.5s. That same scenario used to take 8s less than a week
ago. :)
I'm measuring with nightly rustc, because it's compile times are better
than those of stable thanks to
https://github.com/rust-lang/rust/pull/138522
main (8.2s total):

[cargo-timing.html.zip](https://github.com/user-attachments/files/20364175/cargo-timing.html.zip)
#22be776
(7.5s total):
[cargo-timing-20250521T085303.892834Z.html.zip](https://github.com/user-attachments/files/20364391/cargo-timing-20250521T085303.892834Z.html.zip)

Release Notes:
- N/A
This commit is contained in:
parent
0023b37bfc
commit
77dadfedfe
22 changed files with 42 additions and 92 deletions
|
@ -2,8 +2,10 @@ mod persistence;
|
|||
pub mod terminal_element;
|
||||
pub mod terminal_panel;
|
||||
pub mod terminal_scrollbar;
|
||||
mod terminal_slash_command;
|
||||
pub mod terminal_tab_tooltip;
|
||||
|
||||
use assistant_slash_command::SlashCommandRegistry;
|
||||
use editor::{Editor, EditorSettings, actions::SelectAll, scroll::ScrollbarAutoHide};
|
||||
use gpui::{
|
||||
AnyElement, App, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable, KeyContext,
|
||||
|
@ -29,6 +31,7 @@ use terminal::{
|
|||
use terminal_element::{TerminalElement, is_blank};
|
||||
use terminal_panel::TerminalPanel;
|
||||
use terminal_scrollbar::TerminalScrollHandle;
|
||||
use terminal_slash_command::TerminalSlashCommand;
|
||||
use terminal_tab_tooltip::TerminalTooltip;
|
||||
use ui::{
|
||||
ContextMenu, Icon, IconName, Label, Scrollbar, ScrollbarState, Tooltip, h_flex, prelude::*,
|
||||
|
@ -78,6 +81,7 @@ actions!(terminal, [RerunTask]);
|
|||
impl_actions!(terminal, [SendText, SendKeystroke]);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
assistant_slash_command::init(cx);
|
||||
terminal_panel::init(cx);
|
||||
terminal::init(cx);
|
||||
|
||||
|
@ -87,6 +91,7 @@ pub fn init(cx: &mut App) {
|
|||
workspace.register_action(TerminalView::deploy);
|
||||
})
|
||||
.detach();
|
||||
SlashCommandRegistry::global(cx).register_command(TerminalSlashCommand, true);
|
||||
}
|
||||
|
||||
pub struct BlockProperties {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue