mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fix slow tests sometimes failing
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.
This commit is contained in:
parent
dee5aba43a
commit
a7387cae2c
6 changed files with 51 additions and 14 deletions
|
@ -86,8 +86,10 @@ impl NotifyActor {
|
|||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
}
|
||||
|
||||
let config_version = config.version;
|
||||
|
||||
let n_total = config.load.len();
|
||||
self.send(loader::Message::Progress { n_total, n_done: 0 });
|
||||
self.send(loader::Message::Progress { n_total, n_done: 0, config_version });
|
||||
|
||||
self.watched_entries.clear();
|
||||
|
||||
|
@ -98,7 +100,11 @@ impl NotifyActor {
|
|||
}
|
||||
let files = self.load_entry(entry, watch);
|
||||
self.send(loader::Message::Loaded { files });
|
||||
self.send(loader::Message::Progress { n_total, n_done: i + 1 });
|
||||
self.send(loader::Message::Progress {
|
||||
n_total,
|
||||
n_done: i + 1,
|
||||
config_version,
|
||||
});
|
||||
}
|
||||
}
|
||||
Message::Invalidate(path) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue