@@ -12,13 +12,14 @@ use lsp_types::{
12
12
notification:: { DidOpenTextDocument , Exit } ,
13
13
request:: Shutdown ,
14
14
ClientCapabilities , DidOpenTextDocumentParams , GotoCapability , TextDocumentClientCapabilities ,
15
- TextDocumentIdentifier , TextDocumentItem , Url ,
15
+ TextDocumentIdentifier , TextDocumentItem , Url , WorkDoneProgress ,
16
16
} ;
17
17
use serde:: Serialize ;
18
18
use serde_json:: { to_string_pretty, Value } ;
19
19
use tempfile:: TempDir ;
20
20
use test_utils:: { find_mismatch, parse_fixture} ;
21
21
22
+ use req:: { ProgressParams , ProgressParamsValue } ;
22
23
use rust_analyzer:: { main_loop, req, ServerConfig } ;
23
24
24
25
pub struct Project < ' a > {
@@ -201,10 +202,14 @@ impl Server {
201
202
}
202
203
pub fn wait_until_workspace_is_loaded ( & self ) {
203
204
self . wait_for_message_cond ( 1 , & |msg : & Message | match msg {
204
- Message :: Notification ( n) if n. method == "window/showMessage" => {
205
- let msg =
206
- n. clone ( ) . extract :: < req:: ShowMessageParams > ( "window/showMessage" ) . unwrap ( ) ;
207
- msg. message . starts_with ( "workspace loaded" )
205
+ Message :: Notification ( n) if n. method == "$/progress" => {
206
+ match n. clone ( ) . extract :: < ProgressParams > ( "$/progress" ) . unwrap ( ) {
207
+ ProgressParams {
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
214
_ => false ,
210
215
} )
0 commit comments