Move git status updates to a background thread #2 (#24722)

Follow-up of https://github.com/zed-industries/zed/pull/24307

Brings back the PR and fixes the issue with the git status not
propagated, if computed too slow.
Now, git repo update
* waits in the background for all `scan_dir` repo status updates and
triggers another status update send afterwards
* ensures that the update sent is reported correctly (`scanning = true`)
if either FS or status scan is running still
* during worktree's git statuses updates, bumps `status_scan_id` to
ensure the repo update is reported to all subscribers

Release Notes:

- Improved project panel's speed in large projects
This commit is contained in:
Kirill Bulatov 2025-02-14 16:47:11 +02:00 committed by GitHub
parent 592e8fbffc
commit 744579ede9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 370 additions and 322 deletions

View file

@ -1770,6 +1770,7 @@ impl Workspace {
self.project.read(cx).visible_worktrees(cx)
}
#[cfg(any(test, feature = "test-support"))]
pub fn worktree_scans_complete(&self, cx: &App) -> impl Future<Output = ()> + 'static {
let futures = self
.worktrees(cx)