From 1e96663e20e5e011212db5ebecf21cd919c2ef01 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 31 Jan 2025 17:08:33 -0500 Subject: [PATCH] assistant_context_editor: Don't block `ContextStore` initialization on reloading contexts (#24052) This PR changes the `ContextStore` constructor to not block on reloading the contexts before we finish initializing it. I noticed that the Assistant panel was taking a long time to show up in the status bar, and upon further investigation uncovered that with a large number of contexts (I have ~320) it takes a long time to load them all. Release Notes: - N/A --- crates/assistant_context_editor/src/context_store.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/assistant_context_editor/src/context_store.rs b/crates/assistant_context_editor/src/context_store.rs index e38596d2294d21..91a1553193a8d8 100644 --- a/crates/assistant_context_editor/src/context_store.rs +++ b/crates/assistant_context_editor/src/context_store.rs @@ -144,11 +144,9 @@ impl ContextStore { this.handle_project_changed(project.clone(), cx); this.synchronize_contexts(cx); this.register_context_server_handlers(cx); + this.reload(cx).detach_and_log_err(cx); this })?; - this.update(&mut cx, |this, cx| this.reload(cx))? - .await - .log_err(); Ok(this) })