From 952da31f44b717d5679c1c0baffcd998c0f67266 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 3 Sep 2018 23:32:42 +0300 Subject: switch to internal feedback --- crates/server/src/main_loop/mod.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'crates/server/src/main_loop') diff --git a/crates/server/src/main_loop/mod.rs b/crates/server/src/main_loop/mod.rs index 3d131274f..b66a24de1 100644 --- a/crates/server/src/main_loop/mod.rs +++ b/crates/server/src/main_loop/mod.rs @@ -32,6 +32,7 @@ enum Task { } pub fn main_loop( + internal_mode: bool, root: PathBuf, msg_receriver: &mut Receiver, msg_sender: &mut Sender, @@ -47,6 +48,7 @@ pub fn main_loop( let mut pending_requests = HashMap::new(); let mut subs = Subscriptions::new(); let main_res = main_loop_inner( + internal_mode, root, &pool, msg_sender, @@ -80,6 +82,7 @@ pub fn main_loop( } fn main_loop_inner( + internal_mode: bool, ws_root: PathBuf, pool: &ThreadPool, msg_sender: &mut Sender, @@ -145,8 +148,7 @@ fn main_loop_inner( match ws { Ok(ws) => { let workspaces = vec![ws]; - let not = RawNotification::new::(&workspaces); - msg_sender.send(RawMessage::Notification(not)); + feedback(internal_mode, "workspace loaded", msg_sender); for ws in workspaces.iter() { for pkg in ws.packages().filter(|pkg| !pkg.is_member(ws)) { debug!("sending root, {}", pkg.root(ws).to_path_buf().display()); @@ -404,3 +406,11 @@ fn update_file_notifications_on_threadpool( } }); } + +fn feedback(intrnal_mode: bool, msg: &str, sender: &Sender) { + if !intrnal_mode { + return; + } + let not = RawNotification::new::(&msg.to_string()); + sender.send(RawMessage::Notification(not)); +} -- cgit v1.2.3