From a7387cae2ca9d5e114246e6fada98bfe7808e1d0 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 12 Feb 2021 15:58:29 +0100 Subject: 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. --- crates/rust-analyzer/src/global_state.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/rust-analyzer/src/global_state.rs') diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 6374a9f3c..c3bc8791d 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -67,6 +67,7 @@ pub(crate) struct GlobalState { req_queue: ReqQueue, pub(crate) task_pool: Handle, Receiver>, pub(crate) loader: Handle, Receiver>, + pub(crate) vfs_config_version: u32, pub(crate) flycheck: Vec, pub(crate) flycheck_sender: Sender, pub(crate) flycheck_receiver: Receiver, @@ -120,6 +121,7 @@ impl GlobalState { GlobalState { sender, req_queue: ReqQueue::default(), + vfs_config_version: 0, task_pool, loader, flycheck: Vec::new(), -- cgit v1.2.3