| 1 | //! `/transcript` command. |
| 2 | |
| 3 | use codewhale_command_contract::handler::CommandHandler; |
| 4 | use codewhale_command_contract::metadata::{CommandInfo, RegisterCommand}; |
| 5 | use codewhale_command_contract::outcome::{ |
| 6 | CoreNavigationAction as Action, CoreNavigationCommandResult as CommandResult, |
| 7 | }; |
| 8 | |
| 9 | pub const COMMAND_INFO: CommandInfo = CommandInfo { |
| 10 | name: "transcript", |
| 11 | aliases: &[], |
| 12 | usage: "/transcript", |
| 13 | // Reuse the keybinding description so the command palette and shortcut |
| 14 | // catalog describe the same live-transcript surface in every locale. |
| 15 | description_key: "kb_live_transcript", |
| 16 | }; |
| 17 | |
| 18 | pub struct TranscriptCmd; |
| 19 | |
| 20 | impl RegisterCommand<CommandResult> for TranscriptCmd { |
| 21 | fn info() -> &'static CommandInfo { |
| 22 | &COMMAND_INFO |
| 23 | } |
| 24 | |
| 25 | fn handler() -> CommandHandler<CommandResult> { |
| 26 | CommandHandler::Pure(|_| CommandResult::action(Action::OpenLiveTranscript)) |
| 27 | } |
| 28 | } |
| 29 |