suggested extensions (#9526)

Follow-up from #9138

Release Notes:

- Adds suggested extensions for some filetypes
([#7096](https://github.com/zed-industries/zed/issues/7096)).

---------

Co-authored-by: Felix Zeller <felixazeller@gmail.com>
This commit is contained in:
Conrad Irwin 2024-03-19 10:06:01 -06:00 committed by GitHub
parent 7573f35e8e
commit d6b7f14b51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 318 additions and 37 deletions

View file

@ -1,4 +1,5 @@
mod components;
mod extension_suggest;
use crate::components::ExtensionCard;
use client::telemetry::Telemetry;
@ -25,7 +26,7 @@ use workspace::{
actions!(zed, [Extensions, InstallDevExtension]);
pub fn init(cx: &mut AppContext) {
cx.observe_new_views(move |workspace: &mut Workspace, _cx| {
cx.observe_new_views(move |workspace: &mut Workspace, cx| {
workspace
.register_action(move |workspace, _: &Extensions, cx| {
let extensions_page = ExtensionsPage::new(workspace, cx);
@ -53,6 +54,14 @@ pub fn init(cx: &mut AppContext) {
})
.detach();
});
cx.subscribe(workspace.project(), |_, _, event, cx| match event {
project::Event::LanguageNotFound(buffer) => {
extension_suggest::suggest(buffer.clone(), cx);
}
_ => {}
})
.detach();
})
.detach();
}