Expand description
What an app can do, declared once: each CommandSpec has an id, a title, an icon, a line
saying what it does, a group, a key, the JSON Schema of its arguments, when it is enabled (and
why not), and the function that runs it. The Registry turns that one list into the menus
(Registry::menu_button), the search rows (crate::search), the key bindings
(Registry::bind_keys) and an agent’s tools (kitchen-agent), so none drifts from the
others: a command is in the search because it is in the list, greyed with its reason
wherever it cannot run.
Structs§
- Command
Spec - One thing an app can do.
- Menu
Spec - A menu of a menu row or title bar: its title and its entries.
- Registry
- Every command of an app, shared by its menus, search, keys and agent (a cheap handle: clones share the same list).
- RunCommand
- The action every command key and menu item dispatches: run the command
id(no arguments).
Enums§
- Menu
Item - An entry of a menu.
Functions§
- key_
label - A key in GPUI’s notation as people read it:
secondary-shift-sis “Ctrl+Shift+S” (and “⌘⇧S” on macOS),f3is “F3”.
Type Aliases§
- Checked
Fn - Whether a toggle command is on (a check mark in menus).
- Enabled
Fn - Whether a command can run now;
Errsays why not (shown greyed in menus and search). - Menu
Provider - Makes a menu’s entries when it opens, from what the app holds then (its images, recent
files, the models that fit): see
Registry::provideandMenuItem::Provided. - RunFn
- Runs a command with its arguments (
nullwhen it takes none); its result is JSON (nullfor a plain action), and an error says why it did not run.