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.

Windows: Fix canonicalize return UNC path (#11083)

CharlesChen0823843d299d9a4b
diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs
index b6ddb381a3c..077f811ede6 100644
--- a/crates/worktree/src/worktree.rs
+++ b/crates/worktree/src/worktree.rs
@@ -673,7 +673,11 @@ fn start_background_scan_tasks(
) -> Vec<Task<()>> {
let (scan_states_tx, mut scan_states_rx) = mpsc::unbounded();
let background_scanner = cx.background_executor().spawn({
- let abs_path = abs_path.to_path_buf();
+ let abs_path = if cfg!(target_os = "windows") {
+ abs_path.canonicalize().expect("start background scan tasks failed for canonicalize path {abs_path}")
+ } else {
+ abs_path.to_path_buf()
+ };
let background = cx.background_executor().clone();
async move {
let events = fs.watch(&abs_path, FS_WATCH_LATENCY).await;