Skip to content

Commit

Permalink
assistant_context_editor: Don't block ContextStore initialization o…
Browse files Browse the repository at this point in the history
…n 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
  • Loading branch information
maxdeviant authored Jan 31, 2025
1 parent de3702b commit 1e96663
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/assistant_context_editor/src/context_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down

0 comments on commit 1e96663

Please sign in to comment.