zed/extensions
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
..
astro astro: Bump to v0.0.2 (#11834) 2024-05-14 19:12:43 -04:00
clojure Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
csharp csharp: Bump to v0.0.2 (#10651) 2024-04-16 15:49:16 -04:00
dart dart: Bump to v0.0.2 (#10940) 2024-04-24 13:03:56 -04:00
deno Extract Deno extension (#10912) 2024-04-23 20:44:11 -04:00
elixir elixir: Bump to v0.0.4 (#11446) 2024-05-06 12:41:50 -04:00
elm
emmet emmet: release 0.0.3 (#11873) 2024-05-15 21:27:37 +02:00
erlang
gleam Allow defining slash commands in extensions (#12255) 2024-05-24 15:44:32 -04:00
glsl glsl: Bump to v0.1.0 (#10734) 2024-04-18 11:57:21 -04:00
haskell
html html: Bump to 0.1.1 (#12093) 2024-05-21 18:36:47 +02:00
lua Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
ocaml Add xtask for finding crates with missing licenses (#11776) 2024-05-13 18:52:12 -04:00
php tasks: Provide task variables from matching runnable ranges in task modal (#12237) 2024-05-24 21:00:23 +02:00
prisma prisma: Bump to v0.0.2 (#10689) 2024-04-17 12:40:01 -04:00
purescript
racket Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
ruby tasks: Provide task variables from matching runnable ranges in task modal (#12237) 2024-05-24 21:00:23 +02:00
scheme Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
svelte
terraform terraform: Sync Cargo.toml version with extension.toml version (#10937) 2024-04-24 11:42:18 -04:00
toml toml: Bump to v0.1.1 (#11359) 2024-05-03 11:29:53 -04:00
uiua
vue vue: Bump to v0.0.2 (#11747) 2024-05-13 08:49:40 -04:00
zig zig: Pin ZLS to v0.11.0 (#12173) 2024-05-22 20:47:49 -04:00
.gitignore