Skip to content

Commit 1af6275

Browse files
Merge #6246
6246: Follow symlinks when walking project trees r=lnicola a=dfoxfranke Fixes #3691. ~~WIP pending further testing~~: - [X] Verify that symlinked files get indexed. - [x] Verify that files in symlinked directories get indexed. - [x] Verify that inotify events are properly received and handled when the target of a symlink resides outside the project tree. Co-authored-by: Daniel Fox Franke <dfoxfranke@gmail.com>
2 parents fb2d332 + e821aa8 commit 1af6275

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

crates/vfs-notify/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ impl NotifyActor {
165165
let mut res = Vec::new();
166166

167167
for root in dirs.include.iter() {
168-
let walkdir = WalkDir::new(root).into_iter().filter_entry(|entry| {
169-
if !entry.file_type().is_dir() {
170-
return true;
171-
}
172-
let path = AbsPath::assert(entry.path());
173-
root == path
174-
|| dirs.exclude.iter().chain(&dirs.include).all(|it| it != path)
175-
});
168+
let walkdir =
169+
WalkDir::new(root).follow_links(true).into_iter().filter_entry(|entry| {
170+
if !entry.file_type().is_dir() {
171+
return true;
172+
}
173+
let path = AbsPath::assert(entry.path());
174+
root == path
175+
|| dirs.exclude.iter().chain(&dirs.include).all(|it| it != path)
176+
});
176177

177178
let files = walkdir.filter_map(|it| it.ok()).filter_map(|entry| {
178179
let is_dir = entry.file_type().is_dir();

0 commit comments

Comments
 (0)