@@ -149,8 +149,8 @@ impl GlobalState {
149149 ) ;
150150 }
151151
152- self . fetch_workspaces_queue . request_op ( "startup" . to_string ( ) ) ;
153- if let Some ( cause) = self . fetch_workspaces_queue . should_start_op ( ) {
152+ self . fetch_workspaces_queue . request_op ( "startup" . to_string ( ) , ( ) ) ;
153+ if let Some ( ( cause, ( ) ) ) = self . fetch_workspaces_queue . should_start_op ( ) {
154154 self . fetch_workspaces ( cause) ;
155155 }
156156
@@ -248,7 +248,7 @@ impl GlobalState {
248248 self . prime_caches_queue . op_completed ( ( ) ) ;
249249 if cancelled {
250250 self . prime_caches_queue
251- . request_op ( "restart after cancellation" . to_string ( ) ) ;
251+ . request_op ( "restart after cancellation" . to_string ( ) , ( ) ) ;
252252 }
253253 }
254254 } ;
@@ -280,15 +280,16 @@ impl GlobalState {
280280 if self . is_quiescent ( ) {
281281 let became_quiescent = !( was_quiescent
282282 || self . fetch_workspaces_queue . op_requested ( )
283- || self . fetch_build_data_queue . op_requested ( ) ) ;
283+ || self . fetch_build_data_queue . op_requested ( )
284+ || self . fetch_proc_macros_queue . op_requested ( ) ) ;
284285
285286 if became_quiescent {
286287 if self . config . check_on_save ( ) {
287288 // Project has loaded properly, kick off initial flycheck
288289 self . flycheck . iter ( ) . for_each ( FlycheckHandle :: restart) ;
289290 }
290291 if self . config . prefill_caches ( ) {
291- self . prime_caches_queue . request_op ( "became quiescent" . to_string ( ) ) ;
292+ self . prime_caches_queue . request_op ( "became quiescent" . to_string ( ) , ( ) ) ;
292293 }
293294 }
294295
@@ -358,18 +359,20 @@ impl GlobalState {
358359 }
359360
360361 if self . config . cargo_autoreload ( ) {
361- if let Some ( cause) = self . fetch_workspaces_queue . should_start_op ( ) {
362+ if let Some ( ( cause, ( ) ) ) = self . fetch_workspaces_queue . should_start_op ( ) {
362363 self . fetch_workspaces ( cause) ;
363364 }
364365 }
365366
366367 if !self . fetch_workspaces_queue . op_in_progress ( ) {
367- if let Some ( cause) = self . fetch_build_data_queue . should_start_op ( ) {
368+ if let Some ( ( cause, ( ) ) ) = self . fetch_build_data_queue . should_start_op ( ) {
368369 self . fetch_build_data ( cause) ;
370+ } else if let Some ( ( cause, paths) ) = self . fetch_proc_macros_queue . should_start_op ( ) {
371+ self . fetch_proc_macros ( cause, paths) ;
369372 }
370373 }
371374
372- if let Some ( cause) = self . prime_caches_queue . should_start_op ( ) {
375+ if let Some ( ( cause, ( ) ) ) = self . prime_caches_queue . should_start_op ( ) {
373376 tracing:: debug!( %cause, "will prime caches" ) ;
374377 let num_worker_threads = self . config . prime_caches_num_threads ( ) ;
375378
@@ -463,7 +466,8 @@ impl GlobalState {
463466 let workspaces_updated = !Arc :: ptr_eq ( & old, & self . workspaces ) ;
464467
465468 if self . config . run_build_scripts ( ) && workspaces_updated {
466- self . fetch_build_data_queue . request_op ( format ! ( "workspace updated" ) ) ;
469+ self . fetch_build_data_queue
470+ . request_op ( format ! ( "workspace updated" ) , ( ) ) ;
467471 }
468472
469473 ( Progress :: End , None )
@@ -497,6 +501,7 @@ impl GlobalState {
497501 ProcMacroProgress :: Begin => ( Some ( Progress :: Begin ) , None ) ,
498502 ProcMacroProgress :: Report ( msg) => ( Some ( Progress :: Report ) , Some ( msg) ) ,
499503 ProcMacroProgress :: End ( proc_macro_load_result) => {
504+ self . fetch_proc_macros_queue . op_completed ( true ) ;
500505 self . set_proc_macros ( proc_macro_load_result) ;
501506
502507 ( Some ( Progress :: End ) , None )
@@ -649,7 +654,7 @@ impl GlobalState {
649654
650655 dispatcher
651656 . on_sync_mut :: < lsp_ext:: ReloadWorkspace > ( handlers:: handle_workspace_reload)
652- . on_sync_mut :: < lsp_ext:: ReloadProcMacros > ( handlers:: handle_proc_macros_reload )
657+ . on_sync_mut :: < lsp_ext:: RebuildProcMacros > ( handlers:: handle_proc_macros_rebuild )
653658 . on_sync_mut :: < lsp_ext:: MemoryUsage > ( handlers:: handle_memory_usage)
654659 . on_sync_mut :: < lsp_ext:: ShuffleCrateGraph > ( handlers:: handle_shuffle_crate_graph)
655660 . on_sync :: < lsp_ext:: JoinLines > ( handlers:: handle_join_lines)
@@ -904,7 +909,7 @@ impl GlobalState {
904909 if let Some ( abs_path) = vfs_path. as_path ( ) {
905910 if reload:: should_refresh_for_change ( abs_path, ChangeKind :: Modify ) {
906911 this. fetch_workspaces_queue
907- . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) ) ;
912+ . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) , ( ) ) ;
908913 }
909914 }
910915
@@ -980,7 +985,7 @@ impl GlobalState {
980985 config. workspace_roots . extend ( added) ;
981986 if !config. has_linked_projects ( ) && config. detached_files ( ) . is_empty ( ) {
982987 config. rediscover_workspaces ( ) ;
983- this. fetch_workspaces_queue . request_op ( "client workspaces changed" . to_string ( ) )
988+ this. fetch_workspaces_queue . request_op ( "client workspaces changed" . to_string ( ) , ( ) )
984989 }
985990
986991 Ok ( ( ) )
0 commit comments