diff options
author | Ville Penttinen <[email protected]> | 2019-03-05 19:59:01 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-03-05 19:59:01 +0000 |
commit | 9063dabcca0aaaa6d8bb3364cee21fd68023a059 (patch) | |
tree | ea85c8abd5ba57f0120556987a1c8cc5c6eae19d /crates/ra_lsp_server/tests/heavy_tests | |
parent | ab288a32f9a95e3ca5e9e42f9c6f59bb3849f26e (diff) |
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.
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/support.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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::{ | |||
13 | notification::DidOpenTextDocument, | 13 | notification::DidOpenTextDocument, |
14 | request::{Request, Shutdown}, | 14 | request::{Request, Shutdown}, |
15 | DidOpenTextDocumentParams, TextDocumentIdentifier, TextDocumentItem, Url, | 15 | DidOpenTextDocumentParams, TextDocumentIdentifier, TextDocumentItem, Url, |
16 | notification::{Notification, ShowMessage}, | ||
16 | }; | 17 | }; |
17 | use serde::Serialize; | 18 | use serde::Serialize; |
18 | use serde_json::{to_string_pretty, Value}; | 19 | use serde_json::{to_string_pretty, Value}; |
@@ -56,7 +57,7 @@ impl Server { | |||
56 | "test server", | 57 | "test server", |
57 | 128, | 58 | 128, |
58 | move |mut msg_receiver, mut msg_sender| { | 59 | move |mut msg_receiver, mut msg_sender| { |
59 | main_loop(true, path, true, &mut msg_receiver, &mut msg_sender).unwrap() | 60 | main_loop(path, true, &mut msg_receiver, &mut msg_sender).unwrap() |
60 | }, | 61 | }, |
61 | ); | 62 | ); |
62 | let res = Server { | 63 | let res = Server { |
@@ -138,8 +139,9 @@ impl Server { | |||
138 | } | 139 | } |
139 | pub fn wait_for_feedback_n(&self, feedback: &str, n: usize) { | 140 | pub fn wait_for_feedback_n(&self, feedback: &str, n: usize) { |
140 | let f = |msg: &RawMessage| match msg { | 141 | let f = |msg: &RawMessage| match msg { |
141 | RawMessage::Notification(n) if n.method == "internalFeedback" => { | 142 | RawMessage::Notification(n) if n.method == ShowMessage::METHOD => { |
142 | return n.clone().cast::<req::InternalFeedback>().unwrap() == feedback; | 143 | let message = n.clone().cast::<req::ShowMessage>().unwrap(); |
144 | message.message == feedback | ||
143 | } | 145 | } |
144 | _ => false, | 146 | _ => false, |
145 | }; | 147 | }; |