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:
parent
7573f35e8e
commit
d6b7f14b51
11 changed files with 318 additions and 37 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue