Rewrite permission queries (it no longer blocks)
Co-authored-by: Kyle <kyle@zed.dev> Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
d157e3598d
commit
31fb503418
2 changed files with 51 additions and 62 deletions
|
@ -500,26 +500,12 @@ impl SemanticIndex {
|
|||
project: ModelHandle<Project>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<bool>> {
|
||||
let worktree_scans_complete = project
|
||||
.read(cx)
|
||||
.worktrees(cx)
|
||||
.map(|worktree| {
|
||||
let scan_complete = worktree.read(cx).as_local().unwrap().scan_complete();
|
||||
async move {
|
||||
scan_complete.await;
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let worktrees_indexed_previously = project
|
||||
.read(cx)
|
||||
.worktrees(cx)
|
||||
.map(|worktree| self.worktree_previously_indexed(worktree.read(cx).abs_path()))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
cx.spawn(|_, _cx| async move {
|
||||
futures::future::join_all(worktree_scans_complete).await;
|
||||
|
||||
let worktree_indexed_previously =
|
||||
futures::future::join_all(worktrees_indexed_previously).await;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue