snippets: Add icons and file names to snippet scope selector (#30212)

I added the language icons to the snippet scope selector so that it
matches the language selector.

The file names are displayed for each scope where there is a existing
snippets file since it wasn't clear if a scope had a file already or
not.

| Before | After |
| - | - |
|
![before](https://github.com/user-attachments/assets/89f62889-d4a9-4681-999a-00c00f7bec3b)|
![after](https://github.com/user-attachments/assets/2d64f04c-ef8f-40f5-aedd-eca239c960e9)
|


Release Notes:

- Added language icons and file names to snippet scope selector

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
loczek 2025-05-26 15:44:09 +02:00 committed by GitHub
parent 2a973109d4
commit d4926626d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 134 additions and 21 deletions

View file

@ -1023,7 +1023,7 @@ impl Project {
let (tx, rx) = mpsc::unbounded();
cx.spawn(async move |this, cx| Self::send_buffer_ordered_messages(this, rx, cx).await)
.detach();
let global_snippets_dir = paths::config_dir().join("snippets");
let global_snippets_dir = paths::snippets_dir().to_owned();
let snippets =
SnippetProvider::new(fs.clone(), BTreeSet::from_iter([global_snippets_dir]), cx);