agent_ui: Fix disabled context servers not showing in agent setting (#33856)
Previously if I set enabled: false for one the context servers in settings.json it will not show up in the settings in agent panel when I start zed. But if I enabled it from settings it properly showed up. We were filtering the configuration to only get the enabled context servers from settings.json. This PR adds fetching all of them. Release Notes: - agent: Show context servers which are disabled in settings in agent panel settings.
This commit is contained in:
parent
83562fca77
commit
30a441b714
2 changed files with 10 additions and 1 deletions
|
@ -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))
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue