Files
oak-gpui/crates
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-10 15:50:20 -06:00
2024-05-23 15:50:59 +02:00
2024-04-23 13:31:21 -04:00
2024-03-28 18:32:11 +01: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-30 23:31:59 -06:00
2024-05-10 15:50:20 -06:00
2024-05-10 15:50:20 -06:00
2024-03-11 10:45:57 +01:00
2024-03-26 16:10:09 -07:00
2024-05-23 15:50:59 +02:00
2024-05-09 21:08:49 -06:00
2024-05-23 15:50:59 +02:00
2024-05-22 14:36:15 +03:00
2024-05-23 15:50:59 +02:00
2024-05-23 15:50:59 +02:00
2024-04-15 14:21:52 +02:00
2024-05-03 12:50:42 -07:00