Revert to fix panic in inline assistant (#28428)

This reverts commit f12a554f86, which
introduced a panic in inline assistant (cc @mgsloan) - I'm not sure what
the motivation was for that change, but I figure we can revert to fix
the inline assistant now and deal with that later. 😄

Panic was:

> Thread "main" panicked with "cannot read workspace::Workspace while it
is already being updated" at
/Users/rtfeldman/code/zed/crates/gpui/src/app/entity_map.rs:139:32


Release Notes:

- N/A
This commit is contained in:
Richard Feldman 2025-04-09 11:24:53 -04:00 committed by GitHub
parent 6d7fef6fd3
commit 9d0fe164a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 32 deletions

View file

@ -227,14 +227,14 @@ impl AssistantPanel {
) -> Self {
let thread = thread_store.update(cx, |this, cx| this.create_thread(cx));
let fs = workspace.app_state().fs.clone();
let project = workspace.project();
let project = workspace.project().clone();
let language_registry = project.read(cx).languages().clone();
let workspace = workspace.weak_handle();
let weak_self = cx.entity().downgrade();
let message_editor_context_store = cx.new(|_cx| {
crate::context_store::ContextStore::new(
project.downgrade(),
workspace.clone(),
Some(thread_store.downgrade()),
)
});
@ -344,7 +344,7 @@ impl AssistantPanel {
let message_editor_context_store = cx.new(|_cx| {
crate::context_store::ContextStore::new(
self.project.downgrade(),
self.workspace.clone(),
Some(self.thread_store.downgrade()),
)
});
@ -521,7 +521,7 @@ impl AssistantPanel {
this.set_active_view(thread_view, window, cx);
let message_editor_context_store = cx.new(|_cx| {
crate::context_store::ContextStore::new(
this.project.downgrade(),
this.workspace.clone(),
Some(this.thread_store.downgrade()),
)
});