From 9063dabcca0aaaa6d8bb3364cee21fd68023a059 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Tue, 5 Mar 2019 21:59:01 +0200 Subject: Send an actual ShowMessage instead of InternalFeedback in feedback() This now allows us to send a notification that can be shown in the UI when the workspace has been loaded. Additionally this removes the need for internal_mode flag. --- crates/ra_lsp_server/tests/heavy_tests/support.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_lsp_server/tests') diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs index f4e7eaf75..3a7c50309 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/support.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs @@ -13,6 +13,7 @@ use lsp_types::{ notification::DidOpenTextDocument, request::{Request, Shutdown}, DidOpenTextDocumentParams, TextDocumentIdentifier, TextDocumentItem, Url, + notification::{Notification, ShowMessage}, }; use serde::Serialize; use serde_json::{to_string_pretty, Value}; @@ -56,7 +57,7 @@ impl Server { "test server", 128, move |mut msg_receiver, mut msg_sender| { - main_loop(true, path, true, &mut msg_receiver, &mut msg_sender).unwrap() + main_loop(path, true, &mut msg_receiver, &mut msg_sender).unwrap() }, ); let res = Server { @@ -138,8 +139,9 @@ impl Server { } pub fn wait_for_feedback_n(&self, feedback: &str, n: usize) { let f = |msg: &RawMessage| match msg { - RawMessage::Notification(n) if n.method == "internalFeedback" => { - return n.clone().cast::().unwrap() == feedback; + RawMessage::Notification(n) if n.method == ShowMessage::METHOD => { + let message = n.clone().cast::().unwrap(); + message.message == feedback } _ => false, }; -- cgit v1.2.3