aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-16 13:53:10 +0100
committerGitHub <[email protected]>2020-10-16 13:53:10 +0100
commit1af6275f204fa5a0ec35f3dca96476bcf5112175 (patch)
tree5927fa10a8fea590d1d48777e524f3ffa8f85286 /crates
parentfb2d332f5f6aa45eb282aebdd01de4bc0ef8a39e (diff)
parente821aa842bd3f8beeda6b0c9f18db87af0de8adc (diff)
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 <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/vfs-notify/src/lib.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs
index e1e36612a..c605bcf3c 100644
--- a/crates/vfs-notify/src/lib.rs
+++ b/crates/vfs-notify/src/lib.rs
@@ -165,14 +165,15 @@ impl NotifyActor {
165 let mut res = Vec::new(); 165 let mut res = Vec::new();
166 166
167 for root in dirs.include.iter() { 167 for root in dirs.include.iter() {
168 let walkdir = WalkDir::new(root).into_iter().filter_entry(|entry| { 168 let walkdir =
169 if !entry.file_type().is_dir() { 169 WalkDir::new(root).follow_links(true).into_iter().filter_entry(|entry| {
170 return true; 170 if !entry.file_type().is_dir() {
171 } 171 return true;
172 let path = AbsPath::assert(entry.path()); 172 }
173 root == path 173 let path = AbsPath::assert(entry.path());
174 || dirs.exclude.iter().chain(&dirs.include).all(|it| it != path) 174 root == path
175 }); 175 || dirs.exclude.iter().chain(&dirs.include).all(|it| it != path)
176 });
176 177
177 let files = walkdir.filter_map(|it| it.ok()).filter_map(|entry| { 178 let files = walkdir.filter_map(|it| it.ok()).filter_map(|entry| {
178 let is_dir = entry.file_type().is_dir(); 179 let is_dir = entry.file_type().is_dir();