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 | | - | - | | |  | 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:
parent
2a973109d4
commit
d4926626d8
5 changed files with 134 additions and 21 deletions
|
@ -144,15 +144,13 @@ struct GlobalSnippetWatcher(Entity<SnippetProvider>);
|
|||
|
||||
impl GlobalSnippetWatcher {
|
||||
fn new(fs: Arc<dyn Fs>, cx: &mut App) -> Self {
|
||||
let global_snippets_dir = paths::config_dir().join("snippets");
|
||||
let global_snippets_dir = paths::snippets_dir();
|
||||
let provider = cx.new(|_cx| SnippetProvider {
|
||||
fs,
|
||||
snippets: Default::default(),
|
||||
watch_tasks: vec![],
|
||||
});
|
||||
provider.update(cx, |this, cx| {
|
||||
this.watch_directory(&global_snippets_dir, cx)
|
||||
});
|
||||
provider.update(cx, |this, cx| this.watch_directory(global_snippets_dir, cx));
|
||||
Self(provider)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue