diff --git a/crates/fs/src/fs.rs b/crates/fs/src/fs.rs index be9f3f4e0f..2cf633c021 100644 --- a/crates/fs/src/fs.rs +++ b/crates/fs/src/fs.rs @@ -720,7 +720,16 @@ impl Fs for RealFs { } // Check if path is a symlink and follow the target parent - if let Some(target) = self.read_link(&path).await.ok() { + if let Some(mut target) = self.read_link(&path).await.ok() { + // Check if symlink target is relative path, if so make it absolute + if target.is_relative() { + if let Some(parent) = path.parent() { + target = parent.join(target); + if let Ok(canonical) = self.canonicalize(&target).await { + target = canonical; + } + } + } watcher.add(&target).ok(); if let Some(parent) = target.parent() { watcher.add(parent).log_err();