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::Result;
@@ -155,9 +155,10 @@ impl SlashCommand for SearchSlashCommand {
sections.push(SlashCommandOutputSection {
range: section_start_ix..section_end_ix,
render_placeholder: Arc::new(move |id, unfold, _| {
FilePlaceholder {
EntryPlaceholder {
id,
path: Some(full_path.clone()),
is_directory: false,
line_range: Some(start_row..end_row),
unfold,
}