diff options
author | Aleksey Kladov <[email protected]> | 2021-04-05 20:30:19 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-04-06 10:33:19 +0100 |
commit | aaa8c208b12e3ddb1b4a7fd3d843182ae12cdae5 (patch) | |
tree | a5833c960096a22e38beab5dda78cd4ddd3f736b /crates/rust-analyzer/src/global_state.rs | |
parent | 047b5313013383fc4fafaef6d6d8d6a64549e3cb (diff) |
internal: do not drop errors from cargo metadata/check
Work towards #3155
Diffstat (limited to 'crates/rust-analyzer/src/global_state.rs')
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 8679c8599..b9be1e7b8 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -82,11 +82,16 @@ pub(crate) struct GlobalState { | |||
82 | pub(crate) source_root_config: SourceRootConfig, | 82 | pub(crate) source_root_config: SourceRootConfig, |
83 | pub(crate) proc_macro_client: Option<ProcMacroClient>, | 83 | pub(crate) proc_macro_client: Option<ProcMacroClient>, |
84 | 84 | ||
85 | /// For both `workspaces` and `workspace_build_data`, the field stores the | ||
86 | /// data we actually use, while the `OpQueue` stores the result of the last | ||
87 | /// fetch. | ||
88 | /// | ||
89 | /// If the fetch (partially) fails, we do not update the values. | ||
85 | pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>, | 90 | pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>, |
86 | pub(crate) fetch_workspaces_queue: OpQueue<(), ()>, | 91 | pub(crate) fetch_workspaces_queue: OpQueue<(), Vec<anyhow::Result<ProjectWorkspace>>>, |
87 | |||
88 | pub(crate) workspace_build_data: Option<BuildDataResult>, | 92 | pub(crate) workspace_build_data: Option<BuildDataResult>, |
89 | pub(crate) fetch_build_data_queue: OpQueue<BuildDataCollector, ()>, | 93 | pub(crate) fetch_build_data_queue: |
94 | OpQueue<BuildDataCollector, Option<anyhow::Result<BuildDataResult>>>, | ||
90 | 95 | ||
91 | latest_requests: Arc<RwLock<LatestRequests>>, | 96 | latest_requests: Arc<RwLock<LatestRequests>>, |
92 | } | 97 | } |
@@ -140,10 +145,12 @@ impl GlobalState { | |||
140 | status: Status::default(), | 145 | status: Status::default(), |
141 | source_root_config: SourceRootConfig::default(), | 146 | source_root_config: SourceRootConfig::default(), |
142 | proc_macro_client: None, | 147 | proc_macro_client: None, |
148 | |||
143 | workspaces: Arc::new(Vec::new()), | 149 | workspaces: Arc::new(Vec::new()), |
144 | fetch_workspaces_queue: OpQueue::default(), | 150 | fetch_workspaces_queue: OpQueue::default(), |
145 | workspace_build_data: None, | 151 | workspace_build_data: None, |
146 | fetch_build_data_queue: OpQueue::default(), | 152 | fetch_build_data_queue: OpQueue::default(), |
153 | |||
147 | latest_requests: Default::default(), | 154 | latest_requests: Default::default(), |
148 | } | 155 | } |
149 | } | 156 | } |