assistant panel: Fix panel not reloading after entering credentials (#15531)
This is the revised version of #15527. We also added new events to notify subscribers when new providers are added or removed. Co-Authored-by: Thorsten <thorsten@zed.dev> Release Notes: - N/A --------- Co-authored-by: Thorsten <thorsten@zed.dev> Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
a31dba9fc1
commit
821ce2fc7c
11 changed files with 119 additions and 68 deletions
|
@ -11,8 +11,8 @@ use futures::future::BoxFuture;
|
|||
use futures::stream::BoxStream;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use gpui::{
|
||||
percentage, svg, Animation, AnimationExt, AnyView, AppContext, AsyncAppContext, Model,
|
||||
ModelContext, Render, Subscription, Task, Transformation,
|
||||
percentage, svg, Animation, AnimationExt, AnyView, AppContext, AsyncAppContext, Model, Render,
|
||||
Subscription, Task, Transformation,
|
||||
};
|
||||
use settings::{Settings, SettingsStore};
|
||||
use std::time::Duration;
|
||||
|
@ -67,10 +67,10 @@ impl CopilotChatLanguageModelProvider {
|
|||
}
|
||||
|
||||
impl LanguageModelProviderState for CopilotChatLanguageModelProvider {
|
||||
fn subscribe<T: 'static>(&self, cx: &mut ModelContext<T>) -> Option<Subscription> {
|
||||
Some(cx.observe(&self.state, |_, _, cx| {
|
||||
cx.notify();
|
||||
}))
|
||||
type ObservableEntity = State;
|
||||
|
||||
fn observable_entity(&self) -> Option<gpui::Model<Self::ObservableEntity>> {
|
||||
Some(self.state.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue