zed/crates/assistant_slash_command
Marshall Bowers 68accaeb00
assistant: Improve /docs argument completions (#13876)
This PR improves the completions for arguments in the `/docs` slash
command.

We achieved this by extending the `complete_argument` method on the
`SlashCommand` trait to return a `Vec<ArgumentCompletion>` instead of a
`Vec<String>`.

In addition to the completion `label`, `ArgumentCompletion` has two new
fields that are can be used to customize the completion behavior:

- `new_text`: The actual text that will be inserted when the completion
is accepted, which may be different from what is shown by the completion
label.
- `run_command`: Whether the command is run when the completion is
accepted. This can be set to `false` to allow accepting a completion
without running the command.

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-07-05 13:29:17 -04:00
..
src assistant: Improve /docs argument completions (#13876) 2024-07-05 13:29:17 -04:00
Cargo.toml Preserve sections generated by slash commands when reloading a context (#13199) 2024-06-18 14:49:53 +02:00
LICENSE-GPL Extract SlashCommand trait from assistant (#12252) 2024-05-24 13:03:41 -04:00