assistant2: Wire up context for terminal inline assist (#22108)
This PR updates up the context picker for the terminal's inline assist. Release Notes: - N/A Co-authored-by: Richard <richard@zed.dev> Co-authored-by: Agus <agus@zed.dev>
This commit is contained in:
parent
84392fbc2f
commit
92fb38acb6
2 changed files with 98 additions and 68 deletions
|
@ -221,19 +221,19 @@ impl InlineAssistant {
|
|||
.map_or(false, |provider| provider.is_authenticated(cx))
|
||||
};
|
||||
|
||||
let thread_store = workspace
|
||||
.panel::<AssistantPanel>(cx)
|
||||
.map(|assistant_panel| assistant_panel.read(cx).thread_store().downgrade());
|
||||
|
||||
let handle_assist = |cx: &mut ViewContext<Workspace>| match inline_assist_target {
|
||||
InlineAssistTarget::Editor(active_editor) => {
|
||||
InlineAssistant::update_global(cx, |assistant, cx| {
|
||||
let thread_store = workspace
|
||||
.panel::<AssistantPanel>(cx)
|
||||
.map(|assistant_panel| assistant_panel.read(cx).thread_store().downgrade());
|
||||
|
||||
assistant.assist(&active_editor, cx.view().downgrade(), thread_store, cx)
|
||||
})
|
||||
}
|
||||
InlineAssistTarget::Terminal(active_terminal) => {
|
||||
TerminalInlineAssistant::update_global(cx, |assistant, cx| {
|
||||
assistant.assist(&active_terminal, cx.view().downgrade(), cx)
|
||||
assistant.assist(&active_terminal, cx.view().downgrade(), thread_store, cx)
|
||||
})
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue