From 1aa11eb7e9a579abd2f47b6be61f983ef2bf2f38 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 7 Mar 2019 17:46:17 +0300 Subject: when loading workspace, say how many packages were loaded this should help to debug configuration issues, when you see `0 packages loaded` or something like that. --- crates/ra_lsp_server/src/main_loop.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_lsp_server/src') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index d0c2a95ef..eecf278a8 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -248,8 +248,10 @@ fn main_loop_inner( && pending_libraries.is_empty() && in_flight_libraries == 0 { + let n_packages: usize = state.workspaces.iter().map(|it| it.count()).sum(); if options.show_workspace_loaded { - show_message(req::MessageType::Info, "workspace loaded", msg_sender); + let msg = format!("workspace loaded, {} rust packages", n_packages); + show_message(req::MessageType::Info, msg, msg_sender); } // Only send the notification first time send_workspace_notification = false; @@ -508,12 +510,10 @@ fn update_file_notifications_on_threadpool( }); } -fn show_message>(typ: req::MessageType, msg: M, sender: &Sender) { - let not = RawNotification::new::(&req::ShowMessageParams { - typ, - message: msg.into(), - }); - +fn show_message(typ: req::MessageType, message: impl Into, sender: &Sender) { + let message = message.into(); + let params = req::ShowMessageParams { typ, message }; + let not = RawNotification::new::(¶ms); sender.send(not.into()).unwrap(); } -- cgit v1.2.3