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:
parent
6d7fef6fd3
commit
9d0fe164a7
6 changed files with 40 additions and 32 deletions
|
@ -66,7 +66,7 @@ impl TerminalInlineAssistant {
|
|||
pub fn assist(
|
||||
&mut self,
|
||||
terminal_view: &Entity<TerminalView>,
|
||||
workspace: Entity<Workspace>,
|
||||
workspace: WeakEntity<Workspace>,
|
||||
thread_store: Option<WeakEntity<ThreadStore>>,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
|
@ -75,8 +75,8 @@ impl TerminalInlineAssistant {
|
|||
let assist_id = self.next_assist_id.post_inc();
|
||||
let prompt_buffer =
|
||||
cx.new(|cx| MultiBuffer::singleton(cx.new(|cx| Buffer::local(String::new(), cx)), cx));
|
||||
let project = workspace.read(cx).project().downgrade();
|
||||
let context_store = cx.new(|_cx| ContextStore::new(project, thread_store.clone()));
|
||||
let context_store =
|
||||
cx.new(|_cx| ContextStore::new(workspace.clone(), thread_store.clone()));
|
||||
let codegen = cx.new(|_| TerminalCodegen::new(terminal, self.telemetry.clone()));
|
||||
|
||||
let prompt_editor = cx.new(|cx| {
|
||||
|
@ -87,7 +87,7 @@ impl TerminalInlineAssistant {
|
|||
codegen,
|
||||
self.fs.clone(),
|
||||
context_store.clone(),
|
||||
workspace.downgrade(),
|
||||
workspace.clone(),
|
||||
thread_store.clone(),
|
||||
window,
|
||||
cx,
|
||||
|
@ -106,7 +106,7 @@ impl TerminalInlineAssistant {
|
|||
assist_id,
|
||||
terminal_view,
|
||||
prompt_editor,
|
||||
workspace.downgrade(),
|
||||
workspace.clone(),
|
||||
context_store,
|
||||
window,
|
||||
cx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue