@@ -12,13 +12,14 @@ use lsp_types::{
1212 notification:: { DidOpenTextDocument , Exit } ,
1313 request:: Shutdown ,
1414 ClientCapabilities , DidOpenTextDocumentParams , GotoCapability , TextDocumentClientCapabilities ,
15- TextDocumentIdentifier , TextDocumentItem , Url ,
15+ TextDocumentIdentifier , TextDocumentItem , Url , WorkDoneProgress ,
1616} ;
1717use serde:: Serialize ;
1818use serde_json:: { to_string_pretty, Value } ;
1919use tempfile:: TempDir ;
2020use test_utils:: { find_mismatch, parse_fixture} ;
2121
22+ use req:: { ProgressParams , ProgressParamsValue } ;
2223use rust_analyzer:: { main_loop, req, ServerConfig } ;
2324
2425pub struct Project < ' a > {
@@ -201,10 +202,14 @@ impl Server {
201202 }
202203 pub fn wait_until_workspace_is_loaded ( & self ) {
203204 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+ }
208213 }
209214 _ => false ,
210215 } )
0 commit comments