aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/main_loop.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-04-05 20:30:19 +0100
committerAleksey Kladov <[email protected]>2021-04-06 10:33:19 +0100
commitaaa8c208b12e3ddb1b4a7fd3d843182ae12cdae5 (patch)
treea5833c960096a22e38beab5dda78cd4ddd3f736b /crates/rust-analyzer/src/main_loop.rs
parent047b5313013383fc4fafaef6d6d8d6a64549e3cb (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.rs20
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};
12use ide_db::base_db::VfsPath; 12use ide_db::base_db::VfsPath;
13use lsp_server::{Connection, Notification, Request, Response}; 13use lsp_server::{Connection, Notification, Request, Response};
14use lsp_types::notification::Notification as _; 14use lsp_types::notification::Notification as _;
15use project_model::BuildDataCollector;
15use vfs::ChangeKind; 16use vfs::ChangeKind;
16 17
17use crate::{ 18use 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 };