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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 220 additions and 56 deletions

View file

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