From 9143e3925cd95d30af72745f25e185f65a686d32 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Apr 2021 13:23:09 +0300 Subject: Prepare for more stateless status reporting --- crates/rust-analyzer/src/global_state.rs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (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 b9be1e7b8..44a656e62 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -67,21 +67,25 @@ 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, pub(crate) config: Arc, pub(crate) analysis_host: AnalysisHost, pub(crate) diagnostics: DiagnosticCollection, pub(crate) mem_docs: FxHashMap, pub(crate) semantic_tokens_cache: Arc>>, - pub(crate) vfs: Arc)>>, pub(crate) shutdown_requested: bool, pub(crate) status: Status, pub(crate) source_root_config: SourceRootConfig, pub(crate) proc_macro_client: Option, + pub(crate) flycheck: Vec, + pub(crate) flycheck_sender: Sender, + pub(crate) flycheck_receiver: Receiver, + + pub(crate) vfs: Arc)>>, + pub(crate) vfs_config_version: u32, + pub(crate) vfs_progress_n_total: usize, + pub(crate) vfs_progress_n_done: usize, + /// For both `workspaces` and `workspace_build_data`, the field stores the /// data we actually use, while the `OpQueue` stores the result of the last /// fetch. @@ -129,23 +133,27 @@ impl GlobalState { GlobalState { sender, req_queue: ReqQueue::default(), - vfs_config_version: 0, task_pool, loader, - flycheck: Vec::new(), - flycheck_sender, - flycheck_receiver, config: Arc::new(config), analysis_host, diagnostics: Default::default(), mem_docs: FxHashMap::default(), semantic_tokens_cache: Arc::new(Default::default()), - vfs: Arc::new(RwLock::new((vfs::Vfs::default(), FxHashMap::default()))), shutdown_requested: false, status: Status::default(), source_root_config: SourceRootConfig::default(), proc_macro_client: None, + flycheck: Vec::new(), + flycheck_sender, + flycheck_receiver, + + vfs: Arc::new(RwLock::new((vfs::Vfs::default(), FxHashMap::default()))), + vfs_config_version: 0, + vfs_progress_n_total: 0, + vfs_progress_n_done: 0, + workspaces: Arc::new(Vec::new()), fetch_workspaces_queue: OpQueue::default(), workspace_build_data: None, -- cgit v1.2.3