aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/tests/heavy_tests/support.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/rust-analyzer/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs
index e28ae61fe..1d7062bdf 100644
--- a/crates/rust-analyzer/tests/heavy_tests/support.rs
+++ b/crates/rust-analyzer/tests/heavy_tests/support.rs
@@ -12,13 +12,14 @@ use lsp_types::{
12 notification::{DidOpenTextDocument, Exit}, 12 notification::{DidOpenTextDocument, Exit},
13 request::Shutdown, 13 request::Shutdown,
14 ClientCapabilities, DidOpenTextDocumentParams, GotoCapability, TextDocumentClientCapabilities, 14 ClientCapabilities, DidOpenTextDocumentParams, GotoCapability, TextDocumentClientCapabilities,
15 TextDocumentIdentifier, TextDocumentItem, Url, 15 TextDocumentIdentifier, TextDocumentItem, Url, WorkDoneProgress,
16}; 16};
17use serde::Serialize; 17use serde::Serialize;
18use serde_json::{to_string_pretty, Value}; 18use serde_json::{to_string_pretty, Value};
19use tempfile::TempDir; 19use tempfile::TempDir;
20use test_utils::{find_mismatch, parse_fixture}; 20use test_utils::{find_mismatch, parse_fixture};
21 21
22use req::{ProgressParams, ProgressParamsValue};
22use rust_analyzer::{main_loop, req, ServerConfig}; 23use rust_analyzer::{main_loop, req, ServerConfig};
23 24
24pub struct Project<'a> { 25pub struct Project<'a> {
@@ -201,10 +202,14 @@ impl Server {
201 } 202 }
202 pub fn wait_until_workspace_is_loaded(&self) { 203 pub fn wait_until_workspace_is_loaded(&self) {
203 self.wait_for_message_cond(1, &|msg: &Message| match msg { 204 self.wait_for_message_cond(1, &|msg: &Message| match msg {
204 Message::Notification(n) if n.method == "window/showMessage" => { 205 Message::Notification(n) if n.method == "$/progress" => {
205 let msg = 206 match n.clone().extract::<ProgressParams>("$/progress").unwrap() {
206 n.clone().extract::<req::ShowMessageParams>("window/showMessage").unwrap(); 207 ProgressParams {
207 msg.message.starts_with("workspace loaded") 208 token: req::ProgressToken::String(ref token),
209 value: ProgressParamsValue::WorkDone(WorkDoneProgress::End(_)),
210 } if token == "rustAnalyzer/startup" => true,
211 _ => false,
212 }
208 } 213 }
209 _ => false, 214 _ => false,
210 }) 215 })