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/main_loop.rs | |
parent | 047b5313013383fc4fafaef6d6d8d6a64549e3cb (diff) |
internal: do not drop errors from cargo metadata/check
Work towards #3155
Diffstat (limited to 'crates/rust-analyzer/src/main_loop.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index e88f16cc1..eec6676e0 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -12,6 +12,7 @@ use ide::{Canceled, FileId}; | |||
12 | use ide_db::base_db::VfsPath; | 12 | use ide_db::base_db::VfsPath; |
13 | use lsp_server::{Connection, Notification, Request, Response}; | 13 | use lsp_server::{Connection, Notification, Request, Response}; |
14 | use lsp_types::notification::Notification as _; | 14 | use lsp_types::notification::Notification as _; |
15 | use project_model::BuildDataCollector; | ||
15 | use vfs::ChangeKind; | 16 | use vfs::ChangeKind; |
16 | 17 | ||
17 | use crate::{ | 18 | use crate::{ |
@@ -227,8 +228,15 @@ impl GlobalState { | |||
227 | (Progress::Report, Some(msg)) | 228 | (Progress::Report, Some(msg)) |
228 | } | 229 | } |
229 | ProjectWorkspaceProgress::End(workspaces) => { | 230 | ProjectWorkspaceProgress::End(workspaces) => { |
230 | self.fetch_workspaces_completed(); | 231 | self.fetch_workspaces_completed(workspaces); |
231 | self.switch_workspaces(workspaces, None); | 232 | self.switch_workspaces(); |
233 | if self.config.run_build_scripts() { | ||
234 | let mut collector = BuildDataCollector::default(); | ||
235 | for ws in self.workspaces.iter() { | ||
236 | ws.collect_build_data_configs(&mut collector); | ||
237 | } | ||
238 | self.fetch_build_data_request(collector) | ||
239 | } | ||
232 | (Progress::End, None) | 240 | (Progress::End, None) |
233 | } | 241 | } |
234 | }; | 242 | }; |
@@ -240,11 +248,9 @@ impl GlobalState { | |||
240 | BuildDataProgress::Report(msg) => { | 248 | BuildDataProgress::Report(msg) => { |
241 | (Some(Progress::Report), Some(msg)) | 249 | (Some(Progress::Report), Some(msg)) |
242 | } | 250 | } |
243 | BuildDataProgress::End(collector) => { | 251 | BuildDataProgress::End(build_data_result) => { |
244 | self.fetch_build_data_completed(); | 252 | self.fetch_build_data_completed(build_data_result); |
245 | let workspaces = | 253 | self.switch_workspaces(); |
246 | (*self.workspaces).clone().into_iter().map(Ok).collect(); | ||
247 | self.switch_workspaces(workspaces, Some(collector)); | ||
248 | (Some(Progress::End), None) | 254 | (Some(Progress::End), None) |
249 | } | 255 | } |
250 | }; | 256 | }; |