Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

zeta: Fix update required notification not showing (#25588)

Marshall Bowerse5b61949148c
diff --git a/crates/zed/src/zed/inline_completion_registry.rs b/crates/zed/src/zed/inline_completion_registry.rs
index edd1624033a..fa820f58ec0 100644
--- a/crates/zed/src/zed/inline_completion_registry.rs
+++ b/crates/zed/src/zed/inline_completion_registry.rs
@@ -9,6 +9,7 @@ use settings::SettingsStore;
use std::{cell::RefCell, rc::Rc, sync::Arc};
use supermaven::{Supermaven, SupermavenCompletionProvider};
use ui::Window;
+use workspace::Workspace;
use zeta::{ProviderDataCollection, ZetaInlineCompletionProvider};
pub fn init(client: Arc<Client>, user_store: Entity<UserStore>, cx: &mut App) {
@@ -266,13 +267,13 @@ fn assign_edit_prediction_provider(
}
}
- let zeta = zeta::Zeta::register(
- editor.workspace().map(|w| w.downgrade()),
- worktree,
- client.clone(),
- user_store,
- cx,
- );
+ let workspace = window
+ .root::<Workspace>()
+ .flatten()
+ .map(|workspace| workspace.downgrade());
+
+ let zeta =
+ zeta::Zeta::register(workspace, worktree, client.clone(), user_store, cx);
if let Some(buffer) = &singleton_buffer {
if buffer.read(cx).file().is_some() {
diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs
index 7b91a5a09fe..e2342f9e36a 100644
--- a/crates/zeta/src/zeta.rs
+++ b/crates/zeta/src/zeta.rs
@@ -704,7 +704,10 @@ and then another
can_collect_data: bool,
cx: &mut Context<Self>,
) -> Task<Result<Option<InlineCompletion>>> {
- let workspace = self.workspace.as_ref().and_then(|w| w.upgrade());
+ let workspace = self
+ .workspace
+ .as_ref()
+ .and_then(|workspace| workspace.upgrade());
self.request_completion_impl(
workspace,
project,