language_models: Fix Copilot models not loading (#32288)

Recently in this PR: https://github.com/zed-industries/zed/pull/32248
github copilot settings was introduced. This had missing settings update
which was leading to github copilot models not getting fetched. This had
missing subscription to update the settings inside the copilot language
model provider. Which caused it not show models at all.

cc @osiewicz 

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
Umesh Yadav 2025-06-07 15:02:01 +05:30 committed by GitHub
parent 46773ebbd8
commit 104f601413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,14 @@ impl CopilotChatLanguageModelProvider {
State {
_copilot_chat_subscription: copilot_chat_subscription,
_settings_subscription: cx.observe_global::<SettingsStore>(|_, cx| {
if let Some(copilot_chat) = CopilotChat::global(cx) {
let settings = AllLanguageModelSettings::get_global(cx)
.copilot_chat
.clone();
copilot_chat.update(cx, |chat, cx| {
chat.set_settings(settings, cx);
});
}
cx.notify();
}),
}