Marshall Bowers
82f5f36422
Allow defining slash commands in extensions ( #12255 )
...
This PR adds initial support for defining slash commands for the
Assistant from extensions.
Slash commands are defined in an extension's `extension.toml`:
```toml
[slash_commands.gleam-project]
description = "Returns information about the current Gleam project."
requires_argument = false
```
and then executed via the `run_slash_command` method on the `Extension`
trait:
```rs
impl Extension for GleamExtension {
// ...
fn run_slash_command(
&self,
command: SlashCommand,
_argument: Option<String>,
worktree: &zed::Worktree,
) -> Result<Option<String>, String> {
match command.name.as_str() {
"gleam-project" => Ok(Some("Yayyy".to_string())),
command => Err(format!("unknown slash command: \"{command}\"")),
}
}
}
```
Release Notes:
- N/A
2024-05-24 15:44:32 -04:00
..
2024-05-08 19:13:28 +02:00
2024-05-14 17:47:33 +02:00
2024-04-23 16:23:26 -07:00
2024-05-24 15:44:32 -04:00
2024-05-23 15:22:30 -06:00
2024-05-24 15:44:32 -04:00
2024-05-12 04:47:19 -07:00
2024-03-26 13:28:06 +01:00
2024-05-10 15:50:20 -06:00
2024-04-25 17:42:53 -04:00
2024-05-10 15:50:20 -06:00
2024-05-16 20:02:25 -06:00
2024-05-14 16:05:40 -06:00
2024-05-16 20:02:25 -06:00
2024-03-05 12:01:17 -05:00
2024-05-24 22:26:57 +03:00
2024-05-23 15:50:59 +02:00
2024-03-29 17:09:49 -07:00
2024-03-15 16:58:46 -04:00
2024-05-16 13:30:04 -04:00
2024-03-26 13:28:06 +01:00
2024-05-22 13:51:21 +03:00
2024-04-23 13:31:21 -04:00
2024-05-21 22:39:16 -06:00
2024-05-17 16:58:22 +02:00
2024-05-24 22:26:57 +03:00
2024-05-24 15:44:32 -04:00
2024-05-24 15:44:32 -04:00
2024-03-28 18:32:11 +01:00
2024-05-22 19:45:34 -04:00
2024-04-11 15:36:35 -06:00
2024-05-23 15:50:59 +02:00
2024-05-22 14:36:15 +03:00
2024-04-29 16:37:37 -04:00
2024-05-14 11:00:26 -07:00
2024-04-30 23:31:59 -06:00
2024-03-05 12:01:17 -05:00
2024-05-10 15:50:20 -06:00
2024-05-10 15:50:20 -06:00
2024-05-16 20:28:17 -07:00
2024-05-10 15:50:20 -06:00
2024-05-24 12:32:46 +03:00
2024-05-06 13:56:25 -04:00
2024-05-23 21:11:14 -06:00
2024-05-22 20:40:31 -04:00
2024-05-13 18:52:12 -04:00
2024-05-03 12:50:42 -07:00
2024-03-11 10:45:57 +01:00
2024-04-08 19:17:12 -04:00
2024-05-24 21:00:23 +02:00
2024-03-05 12:01:17 -05:00
2024-05-16 17:18:32 -04:00
2024-05-24 21:00:23 +02:00
2024-04-25 22:37:40 -04:00
2024-05-10 14:18:40 -04:00
2024-05-22 16:32:06 +02:00
2024-05-21 22:39:16 -06:00
2024-04-26 21:34:45 +02:00
2024-04-02 13:12:38 -06:00
2024-03-26 16:10:09 -07:00
2024-05-23 15:50:59 +02:00
2024-05-22 06:14:44 +02:00
2024-04-02 20:40:00 -06:00
2024-05-14 10:43:24 +02:00
2024-05-16 20:28:17 -07:00
2024-05-20 10:52:04 -04:00
2024-05-22 06:19:32 +02:00
2024-05-24 15:44:32 -04:00
2024-05-24 12:15:48 +03:00
2024-03-05 12:01:17 -05:00
2024-04-17 13:20:47 +02:00
2024-05-24 12:15:48 +03:00
2024-03-05 12:01:17 -05:00
2024-05-09 21:08:49 -06:00
2024-04-23 16:23:26 -07:00
2024-05-23 15:50:59 +02:00
2024-05-24 22:26:57 +03:00
2024-05-22 07:35:00 +03:00
2024-05-16 19:43:26 +03:00
2024-03-29 12:11:57 -04:00
2024-05-16 13:30:04 -04:00
2024-05-20 17:00:27 +02:00
2024-05-02 11:00:08 -06:00
2024-03-05 12:01:17 -05:00
2024-05-09 11:03:33 +02:00
2024-05-16 18:32:53 -04:00
2024-05-21 20:23:37 +02:00
2024-05-17 16:37:17 -04:00
2024-05-13 18:52:12 -04:00
2024-05-14 13:48:36 +02:00
2024-05-24 22:26:57 +03:00
2024-05-24 22:26:57 +03:00
2024-05-16 17:18:32 -04:00
2024-05-22 14:36:15 +03:00
2024-05-22 22:28:00 -06:00
2024-05-24 18:24:03 +02:00
2024-05-23 15:50:59 +02:00
2024-05-23 15:50:59 +02:00
2024-05-16 13:30:04 -04:00
2024-04-15 14:21:52 +02:00
2024-05-21 22:39:16 -06:00
2024-05-06 13:22:47 -04:00
2024-05-22 22:07:29 -07:00
2024-05-10 11:06:32 +02:00
2024-05-22 12:54:41 -06:00
2024-05-03 12:50:42 -07:00
2024-05-24 22:26:57 +03:00
2024-05-20 16:48:24 -06:00
2024-05-24 22:26:57 +03:00
2024-03-05 12:01:17 -05:00