Fix relative path opening from project symbols

Co-Authored-By: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-01-08 13:56:52 -07:00
parent 604fcd8f1d
commit 71149bc7cc
5 changed files with 27 additions and 20 deletions

View file

@ -559,7 +559,7 @@ impl SemanticIndex {
.spawn(async move {
let mut changed_paths = BTreeMap::new();
for file in worktree.files(false, 0) {
let absolute_path = worktree.absolutize(&file.path);
let absolute_path = worktree.absolutize(&file.path)?;
if file.is_external || file.is_ignored || file.is_symlink {
continue;
@ -1068,11 +1068,10 @@ impl SemanticIndex {
return true;
};
worktree_state.changed_paths.retain(|path, info| {
for (path, info) in &worktree_state.changed_paths {
if info.is_deleted {
files_to_delete.push((worktree_state.db_id, path.clone()));
} else {
let absolute_path = worktree.read(cx).absolutize(path);
} else if let Ok(absolute_path) = worktree.read(cx).absolutize(path) {
let job_handle = JobHandle::new(pending_file_count_tx);
pending_files.push(PendingFile {
absolute_path,
@ -1083,9 +1082,8 @@ impl SemanticIndex {
worktree_db_id: worktree_state.db_id,
});
}
false
});
}
worktree_state.changed_paths.clear();
true
});