diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-07 14:48:37 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-07 14:48:37 +0000 |
commit | a41d8e140ca65cb87bf6e69a35c3e86410aba374 (patch) | |
tree | e349e903732fe18a78a02f9bc98342c540fbec14 /crates/ra_lsp_server/src | |
parent | 5232099977d07492c1b6d5e6163c70d4f6eb07df (diff) | |
parent | 1aa11eb7e9a579abd2f47b6be61f983ef2bf2f38 (diff) |
Merge #946
946: when loading workspace, say how many packages were loaded r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 14 |
1 files changed, 7 insertions, 7 deletions
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( | |||
248 | && pending_libraries.is_empty() | 248 | && pending_libraries.is_empty() |
249 | && in_flight_libraries == 0 | 249 | && in_flight_libraries == 0 |
250 | { | 250 | { |
251 | let n_packages: usize = state.workspaces.iter().map(|it| it.count()).sum(); | ||
251 | if options.show_workspace_loaded { | 252 | if options.show_workspace_loaded { |
252 | show_message(req::MessageType::Info, "workspace loaded", msg_sender); | 253 | let msg = format!("workspace loaded, {} rust packages", n_packages); |
254 | show_message(req::MessageType::Info, msg, msg_sender); | ||
253 | } | 255 | } |
254 | // Only send the notification first time | 256 | // Only send the notification first time |
255 | send_workspace_notification = false; | 257 | send_workspace_notification = false; |
@@ -508,12 +510,10 @@ fn update_file_notifications_on_threadpool( | |||
508 | }); | 510 | }); |
509 | } | 511 | } |
510 | 512 | ||
511 | fn show_message<M: Into<String>>(typ: req::MessageType, msg: M, sender: &Sender<RawMessage>) { | 513 | fn show_message(typ: req::MessageType, message: impl Into<String>, sender: &Sender<RawMessage>) { |
512 | let not = RawNotification::new::<req::ShowMessage>(&req::ShowMessageParams { | 514 | let message = message.into(); |
513 | typ, | 515 | let params = req::ShowMessageParams { typ, message }; |
514 | message: msg.into(), | 516 | let not = RawNotification::new::<req::ShowMessage>(¶ms); |
515 | }); | ||
516 | |||
517 | sender.send(not.into()).unwrap(); | 517 | sender.send(not.into()).unwrap(); |
518 | } | 518 | } |
519 | 519 | ||