aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/global_state.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-02-12 14:58:29 +0000
committerFlorian Diebold <[email protected]>2021-02-12 15:31:16 +0000
commita7387cae2ca9d5e114246e6fada98bfe7808e1d0 (patch)
treedb0fe8d939afaa10929debf317be670f79909c9f /crates/rust-analyzer/src/global_state.rs
parentdee5aba43a1b45131bf31268431fa71923f2ef2a (diff)
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.
Diffstat (limited to 'crates/rust-analyzer/src/global_state.rs')
-rw-r--r--crates/rust-analyzer/src/global_state.rs2
1 files changed, 2 insertions, 0 deletions
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 {
67 req_queue: ReqQueue, 67 req_queue: ReqQueue,
68 pub(crate) task_pool: Handle<TaskPool<Task>, Receiver<Task>>, 68 pub(crate) task_pool: Handle<TaskPool<Task>, Receiver<Task>>,
69 pub(crate) loader: Handle<Box<dyn vfs::loader::Handle>, Receiver<vfs::loader::Message>>, 69 pub(crate) loader: Handle<Box<dyn vfs::loader::Handle>, Receiver<vfs::loader::Message>>,
70 pub(crate) vfs_config_version: u32,
70 pub(crate) flycheck: Vec<FlycheckHandle>, 71 pub(crate) flycheck: Vec<FlycheckHandle>,
71 pub(crate) flycheck_sender: Sender<flycheck::Message>, 72 pub(crate) flycheck_sender: Sender<flycheck::Message>,
72 pub(crate) flycheck_receiver: Receiver<flycheck::Message>, 73 pub(crate) flycheck_receiver: Receiver<flycheck::Message>,
@@ -120,6 +121,7 @@ impl GlobalState {
120 GlobalState { 121 GlobalState {
121 sender, 122 sender,
122 req_queue: ReqQueue::default(), 123 req_queue: ReqQueue::default(),
124 vfs_config_version: 0,
123 task_pool, 125 task_pool,
124 loader, 126 loader,
125 flycheck: Vec::new(), 127 flycheck: Vec::new(),