diff options
author | Edwin Cheng <[email protected]> | 2021-01-28 15:33:02 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2021-01-28 17:04:14 +0000 |
commit | 9358eecc042d8b551f58d2d5ddb9c88d258880c1 (patch) | |
tree | 7188b0e27d9d00640b5c76319ee59b2d5cab1b05 /crates/rust-analyzer/src/global_state.rs | |
parent | f421ee672253499b8ca8d1badf98db42525a5216 (diff) |
Async Loading outdir and proc-macro
Diffstat (limited to 'crates/rust-analyzer/src/global_state.rs')
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 442fbd14c..6374a9f3c 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -11,7 +11,9 @@ use ide::{Analysis, AnalysisHost, Change, FileId}; | |||
11 | use ide_db::base_db::{CrateId, VfsPath}; | 11 | use ide_db::base_db::{CrateId, VfsPath}; |
12 | use lsp_types::{SemanticTokens, Url}; | 12 | use lsp_types::{SemanticTokens, Url}; |
13 | use parking_lot::{Mutex, RwLock}; | 13 | use parking_lot::{Mutex, RwLock}; |
14 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | 14 | use project_model::{ |
15 | BuildDataCollector, BuildDataResult, CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target, | ||
16 | }; | ||
15 | use rustc_hash::FxHashMap; | 17 | use rustc_hash::FxHashMap; |
16 | use vfs::AnchoredPathBuf; | 18 | use vfs::AnchoredPathBuf; |
17 | 19 | ||
@@ -33,7 +35,7 @@ use crate::{ | |||
33 | #[derive(Eq, PartialEq, Copy, Clone)] | 35 | #[derive(Eq, PartialEq, Copy, Clone)] |
34 | pub(crate) enum Status { | 36 | pub(crate) enum Status { |
35 | Loading, | 37 | Loading, |
36 | Ready, | 38 | Ready { partial: bool }, |
37 | Invalid, | 39 | Invalid, |
38 | NeedsReload, | 40 | NeedsReload, |
39 | } | 41 | } |
@@ -79,7 +81,9 @@ pub(crate) struct GlobalState { | |||
79 | pub(crate) source_root_config: SourceRootConfig, | 81 | pub(crate) source_root_config: SourceRootConfig, |
80 | pub(crate) proc_macro_client: Option<ProcMacroClient>, | 82 | pub(crate) proc_macro_client: Option<ProcMacroClient>, |
81 | pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>, | 83 | pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>, |
82 | pub(crate) fetch_workspaces_queue: OpQueue, | 84 | pub(crate) fetch_workspaces_queue: OpQueue<()>, |
85 | pub(crate) workspace_build_data: Option<BuildDataResult>, | ||
86 | pub(crate) fetch_build_data_queue: OpQueue<BuildDataCollector>, | ||
83 | latest_requests: Arc<RwLock<LatestRequests>>, | 87 | latest_requests: Arc<RwLock<LatestRequests>>, |
84 | } | 88 | } |
85 | 89 | ||
@@ -133,6 +137,8 @@ impl GlobalState { | |||
133 | proc_macro_client: None, | 137 | proc_macro_client: None, |
134 | workspaces: Arc::new(Vec::new()), | 138 | workspaces: Arc::new(Vec::new()), |
135 | fetch_workspaces_queue: OpQueue::default(), | 139 | fetch_workspaces_queue: OpQueue::default(), |
140 | workspace_build_data: None, | ||
141 | fetch_build_data_queue: OpQueue::default(), | ||
136 | latest_requests: Default::default(), | 142 | latest_requests: Default::default(), |
137 | } | 143 | } |
138 | } | 144 | } |