Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent_ui: Fix disabled context servers not showing in agent setting (#33856)

Umesh Yadav30a441b7149d
diff --git a/crates/agent_ui/src/agent_configuration.rs b/crates/agent_ui/src/agent_configuration.rs
index d91aa5fb220..8bfdd507611 100644
--- a/crates/agent_ui/src/agent_configuration.rs
+++ b/crates/agent_ui/src/agent_configuration.rs
@@ -436,7 +436,7 @@ impl AgentConfiguration {
window: &mut Window,
cx: &mut Context<Self>,
) -> impl IntoElement {
- let context_server_ids = self.context_server_store.read(cx).all_server_ids().clone();
+ let context_server_ids = self.context_server_store.read(cx).configured_server_ids();
v_flex()
.p(DynamicSpacing::Base16.rems(cx))
diff --git a/crates/project/src/context_server_store.rs b/crates/project/src/context_server_store.rs
index d2541e1b31f..fd31e638d4b 100644
--- a/crates/project/src/context_server_store.rs
+++ b/crates/project/src/context_server_store.rs
@@ -171,6 +171,15 @@ impl ContextServerStore {
)
}
+ /// Returns all configured context server ids, regardless of enabled state.
+ pub fn configured_server_ids(&self) -> Vec<ContextServerId> {
+ self.context_server_settings
+ .keys()
+ .cloned()
+ .map(ContextServerId)
+ .collect()
+ }
+
#[cfg(any(test, feature = "test-support"))]
pub fn test(
registry: Entity<ContextServerDescriptorRegistry>,