aboutsummaryrefslogtreecommitdiff
path: root/crates/vfs-notify
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-12 16:45:58 +0000
committerGitHub <[email protected]>2021-02-12 16:45:58 +0000
commitcf44953210cbfe189043417690fabd0037a6e74e (patch)
tree357232094eb1bc5a98362fb6ec2d6d65160573be /crates/vfs-notify
parent777d936c17631dfc32a37bd919e45597b83349e4 (diff)
parent8c196056d5d51b0c7395eab399f548fc38b9573b (diff)
Merge #7652
7652: Fix slow tests sometimes failing r=flodiebold a=flodiebold In some situations we reloaded the workspace in the tests after having reported to be ready. There's two fixes here: 1. Add a version to the VFS config and include that version in progress reports, so that we don't think we're done prematurely; 2. Delay status transitions until after changes are applied. Otherwise the last change during loading can potentially trigger a workspace reload, if it contains interesting changes. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/vfs-notify')
-rw-r--r--crates/vfs-notify/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs
index c605bcf3c..f7ae0577d 100644
--- a/crates/vfs-notify/src/lib.rs
+++ b/crates/vfs-notify/src/lib.rs
@@ -86,8 +86,10 @@ impl NotifyActor {
86 self.watcher = watcher.map(|it| (it, watcher_receiver)); 86 self.watcher = watcher.map(|it| (it, watcher_receiver));
87 } 87 }
88 88
89 let config_version = config.version;
90
89 let n_total = config.load.len(); 91 let n_total = config.load.len();
90 self.send(loader::Message::Progress { n_total, n_done: 0 }); 92 self.send(loader::Message::Progress { n_total, n_done: 0, config_version });
91 93
92 self.watched_entries.clear(); 94 self.watched_entries.clear();
93 95
@@ -98,7 +100,11 @@ impl NotifyActor {
98 } 100 }
99 let files = self.load_entry(entry, watch); 101 let files = self.load_entry(entry, watch);
100 self.send(loader::Message::Loaded { files }); 102 self.send(loader::Message::Loaded { files });
101 self.send(loader::Message::Progress { n_total, n_done: i + 1 }); 103 self.send(loader::Message::Progress {
104 n_total,
105 n_done: i + 1,
106 config_version,
107 });
102 } 108 }
103 } 109 }
104 Message::Invalidate(path) => { 110 Message::Invalidate(path) => {