Revert "assistant panel: Fix entering credentials not updating view" (#15528)

Reverts zed-industries/zed#15527

We broke the assistant panel in the process...

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2024-07-31 13:26:27 +02:00 committed by GitHub
parent b571bc800d
commit 380a19fcf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 52 additions and 92 deletions

View file

@ -86,25 +86,10 @@ pub trait LanguageModelProvider: 'static {
fn authenticate(&self, cx: &mut AppContext) -> Task<Result<()>>;
fn authentication_prompt(&self, cx: &mut WindowContext) -> AnyView;
fn reset_credentials(&self, cx: &mut AppContext) -> Task<Result<()>>;
// fn observable_entity(&self) ;
}
pub trait LanguageModelProviderState: 'static {
type ObservableEntity;
fn observable_entity(&self) -> Option<gpui::Model<Self::ObservableEntity>>;
fn subscribe<T: 'static>(
&self,
cx: &mut gpui::ModelContext<T>,
callback: impl Fn(&mut T, &mut gpui::ModelContext<T>) + 'static,
) -> Option<gpui::Subscription> {
let entity = self.observable_entity()?;
Some(cx.observe(&entity, move |this, _, cx| {
callback(this, cx);
}))
}
fn subscribe<T: 'static>(&self, cx: &mut gpui::ModelContext<T>) -> Option<gpui::Subscription>;
}
#[derive(Clone, Eq, PartialEq, Hash, Debug, Ord, PartialOrd)]