assistant: Add glob matching for file slash command (#13137)

This PR adds support for glob matching when using the `file` slash
command inside the assistant panel:


https://github.com/zed-industries/zed/assets/53836821/696612d2-486c-4ab0-bf3c-d23a3eeefd25

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner
2024-06-17 13:53:27 +02:00
committed by GitHub
parent c793bbde84
commit d5735dab9a
4 changed files with 220 additions and 56 deletions
@@ -1,5 +1,5 @@
use super::{
file_command::{codeblock_fence_for_path, FilePlaceholder},
file_command::{codeblock_fence_for_path, EntryPlaceholder},
SlashCommand, SlashCommandOutput,
};
use anyhow::{anyhow, Result};
@@ -84,9 +84,10 @@ impl SlashCommand for ActiveSlashCommand {
sections: vec![SlashCommandOutputSection {
range,
render_placeholder: Arc::new(move |id, unfold, _| {
FilePlaceholder {
EntryPlaceholder {
id,
path: path.clone(),
is_directory: false,
line_range: None,
unfold,
}