mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +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
|
@ -67,6 +67,7 @@ pub(crate) struct GlobalState {
|
|||
req_queue: ReqQueue,
|
||||
pub(crate) task_pool: Handle<TaskPool<Task>, Receiver<Task>>,
|
||||
pub(crate) loader: Handle<Box<dyn vfs::loader::Handle>, Receiver<vfs::loader::Message>>,
|
||||
pub(crate) vfs_config_version: u32,
|
||||
pub(crate) flycheck: Vec<FlycheckHandle>,
|
||||
pub(crate) flycheck_sender: Sender<flycheck::Message>,
|
||||
pub(crate) flycheck_receiver: Receiver<flycheck::Message>,
|
||||
|
@ -120,6 +121,7 @@ impl GlobalState {
|
|||
GlobalState {
|
||||
sender,
|
||||
req_queue: ReqQueue::default(),
|
||||
vfs_config_version: 0,
|
||||
task_pool,
|
||||
loader,
|
||||
flycheck: Vec::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue