menu.rs

 1use gpui::actions;
 2
 3// If the zed binary doesn't use anything in this crate, it will be optimized away
 4// and the actions won't initialize. So we just provide an empty initialization function
 5// to be called from main.
 6//
 7// These may provide relevant context:
 8// https://github.com/rust-lang/rust/issues/47384
 9// https://github.com/mmastrac/rust-ctor/issues/280
10pub fn init() {}
11
12actions!(
13    menu,
14    [
15        /// Cancels the current menu operation.
16        Cancel,
17        /// Confirms the selected menu item.
18        Confirm,
19        /// Performs secondary confirmation action.
20        SecondaryConfirm,
21        /// Selects the previous item in the menu.
22        SelectPrevious,
23        /// Selects the next item in the menu.
24        SelectNext,
25        /// Selects the first item in the menu.
26        SelectFirst,
27        /// Selects the last item in the menu.
28        SelectLast,
29        /// Enters a submenu (navigates to child menu).
30        SelectChild,
31        /// Exits a submenu (navigates to parent menu).
32        SelectParent,
33        /// Restarts the menu from the beginning.
34        Restart,
35        EndSlot,
36    ]
37);