diff options
Diffstat (limited to 'crates/ra_vfs/src/lib.rs')
-rw-r--r-- | crates/ra_vfs/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index b80c12058..d4ba2cb45 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs | |||
@@ -27,10 +27,11 @@ use thread_worker::{WorkerHandle, Worker}; | |||
27 | 27 | ||
28 | use crate::{ | 28 | use crate::{ |
29 | arena::{ArenaId, Arena}, | 29 | arena::{ArenaId, Arena}, |
30 | io::FileEvent, | 30 | io::{FileEvent, FsWorker}, |
31 | }; | 31 | }; |
32 | 32 | ||
33 | /// `RootFilter` is a predicate that checks if a file can belong to a root | 33 | /// `RootFilter` is a predicate that checks if a file can belong to a root. If |
34 | /// several filters match a file (nested dirs), the most nested one wins. | ||
34 | struct RootFilter { | 35 | struct RootFilter { |
35 | root: PathBuf, | 36 | root: PathBuf, |
36 | file_filter: fn(&Path) -> bool, | 37 | file_filter: fn(&Path) -> bool, |
@@ -86,7 +87,7 @@ struct Vfs { | |||
86 | roots: Arena<VfsRoot, RootFilter>, | 87 | roots: Arena<VfsRoot, RootFilter>, |
87 | files: Arena<VfsFile, VfsFileData>, | 88 | files: Arena<VfsFile, VfsFileData>, |
88 | // pending_changes: Vec<PendingChange>, | 89 | // pending_changes: Vec<PendingChange>, |
89 | worker: Worker<PathBuf, (PathBuf, Vec<FileEvent>)>, | 90 | worker: FsWorker, |
90 | worker_handle: WorkerHandle, | 91 | worker_handle: WorkerHandle, |
91 | } | 92 | } |
92 | 93 | ||
@@ -101,6 +102,7 @@ impl Vfs { | |||
101 | worker_handle, | 102 | worker_handle, |
102 | }; | 103 | }; |
103 | 104 | ||
105 | // A hack to make nesting work. | ||
104 | roots.sort_by_key(|it| Reverse(it.as_os_str().len())); | 106 | roots.sort_by_key(|it| Reverse(it.as_os_str().len())); |
105 | 107 | ||
106 | for path in roots { | 108 | for path in roots { |