mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Add is_watch_enabled method to VFS and enhance prefetch cache tests
- Introduced `is_watch_enabled` method to check the status of automatic file watching in the VFS. - Added a new test for prefetch cache to validate metadata retrieval and error handling for walked roots and external paths. - Updated the `watch` method in `StdBackend` for cleaner logic. - Enhanced the `dir_init` field in `PrefetchCache` to store resolved init-file information for directories, improving prefetch operations.
This commit is contained in:
parent
8b18dc451a
commit
5275d45adc
6 changed files with 91 additions and 9 deletions
|
|
@ -331,12 +331,8 @@ impl VfsBackend for StdBackend {
|
|||
}
|
||||
|
||||
fn watch(&mut self, path: &Path, recursive: bool) -> io::Result<()> {
|
||||
if self.watches.contains(path) {
|
||||
if !recursive || self.recursive_watches.contains(path) {
|
||||
return Ok(());
|
||||
}
|
||||
// Upgrade: path was watched non-recursively, now needs recursive.
|
||||
// Fall through to re-issue the watch with RecursiveMode::Recursive.
|
||||
if self.watches.contains(path) && (!recursive || self.recursive_watches.contains(path)) {
|
||||
return Ok(());
|
||||
}
|
||||
if path
|
||||
.ancestors()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue