mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
rustdoc: Don't start indexing if a crate is already being indexed (#13149)
This PR updates the rustdoc indexing to not start indexing a crate that is already being indexed. Currently the indexing of a crate might get continuously interrupted by the user's typing, resulting in thrashing of the indexing task and never indexing the crate in its entirety. Release Notes: - N/A
This commit is contained in:
parent
16fce64d3a
commit
0c28b6a11a
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user