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.

rustdoc: Don't start indexing if a crate is already being indexed (#13149)

Marshall Bowers0c28b6a11afd
diff --git a/crates/rustdoc/src/store.rs b/crates/rustdoc/src/store.rs
index 50ebf83510f..56859144ff6 100644
--- a/crates/rustdoc/src/store.rs
+++ b/crates/rustdoc/src/store.rs
@@ -89,6 +89,10 @@ impl RustdocStore {
crate_name: CrateName,
provider: Box<dyn RustdocProvider + Send + Sync + 'static>,
) -> Shared<Task<Result<(), Arc<anyhow::Error>>>> {
+ if let Some(existing_task) = self.indexing_tasks_by_crate.read().get(&crate_name) {
+ return existing_task.clone();
+ }
+
let indexing_task = self
.executor
.spawn({