Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Use update_default_global to filter command palette items for copilot
Antonio Scandurrae5192a4853ca
diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rsindex 182db084a1d..1f826474180 100644--- a/crates/copilot/src/copilot.rs+++ b/crates/copilot/src/copilot.rs@@ -48,8 +48,8 @@ pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mutcx.observe(&copilot, |handle, cx| {let status = handle.read(cx).status();- cx.update_global::<collections::CommandPaletteFilter, _, _>(- move |filter, _cx| match status {+ cx.update_default_global::<collections::CommandPaletteFilter, _, _>(move |filter, _cx| {+ match status {Status::Disabled => {filter.filtered_namespaces.insert(COPILOT_NAMESPACE);filter.filtered_namespaces.insert(COPILOT_AUTH_NAMESPACE);@@ -62,8 +62,8 @@ pub fn init(http: Arc<dyn HttpClient>, node_runtime: Arc<NodeRuntime>, cx: &mutfilter.filtered_namespaces.insert(COPILOT_NAMESPACE);filter.filtered_namespaces.remove(COPILOT_AUTH_NAMESPACE);}- },- );+ }+ });}).detach();