assistant: Fix evaluating slash commands in slash command output (like /default) (#20864)

This PR fixes an issue where slash commands in the output of other slash
commands were not being evaluated when configured to do so.

Closes https://github.com/zed-industries/zed/issues/20820.

Release Notes:

- Fixed slash commands from other slash commands (like `/default`) not
being evaluated (Preview only).
This commit is contained in:
Marshall Bowers 2024-11-19 11:20:30 -05:00 committed by GitHub
parent 6a2c712990
commit f5cbfa718e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 30 deletions

View file

@ -69,6 +69,10 @@ impl SlashCommand for DefaultSlashCommand {
text.push('\n');
}
if !text.ends_with('\n') {
text.push('\n');
}
Ok(SlashCommandOutput {
sections: vec![SlashCommandOutputSection {
range: 0..text.len(),