@@ -149,8 +149,8 @@ impl GlobalState {
149
149
) ;
150
150
}
151
151
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 ( ) {
154
154
self . fetch_workspaces ( cause) ;
155
155
}
156
156
@@ -248,7 +248,7 @@ impl GlobalState {
248
248
self . prime_caches_queue . op_completed ( ( ) ) ;
249
249
if cancelled {
250
250
self . prime_caches_queue
251
- . request_op ( "restart after cancellation" . to_string ( ) ) ;
251
+ . request_op ( "restart after cancellation" . to_string ( ) , ( ) ) ;
252
252
}
253
253
}
254
254
} ;
@@ -280,15 +280,16 @@ impl GlobalState {
280
280
if self . is_quiescent ( ) {
281
281
let became_quiescent = !( was_quiescent
282
282
|| 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 ( ) ) ;
284
285
285
286
if became_quiescent {
286
287
if self . config . check_on_save ( ) {
287
288
// Project has loaded properly, kick off initial flycheck
288
289
self . flycheck . iter ( ) . for_each ( FlycheckHandle :: restart) ;
289
290
}
290
291
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 ( ) , ( ) ) ;
292
293
}
293
294
}
294
295
@@ -358,18 +359,20 @@ impl GlobalState {
358
359
}
359
360
360
361
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 ( ) {
362
363
self . fetch_workspaces ( cause) ;
363
364
}
364
365
}
365
366
366
367
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 ( ) {
368
369
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) ;
369
372
}
370
373
}
371
374
372
- if let Some ( cause) = self . prime_caches_queue . should_start_op ( ) {
375
+ if let Some ( ( cause, ( ) ) ) = self . prime_caches_queue . should_start_op ( ) {
373
376
tracing:: debug!( %cause, "will prime caches" ) ;
374
377
let num_worker_threads = self . config . prime_caches_num_threads ( ) ;
375
378
@@ -463,7 +466,8 @@ impl GlobalState {
463
466
let workspaces_updated = !Arc :: ptr_eq ( & old, & self . workspaces ) ;
464
467
465
468
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" ) , ( ) ) ;
467
471
}
468
472
469
473
( Progress :: End , None )
@@ -497,6 +501,7 @@ impl GlobalState {
497
501
ProcMacroProgress :: Begin => ( Some ( Progress :: Begin ) , None ) ,
498
502
ProcMacroProgress :: Report ( msg) => ( Some ( Progress :: Report ) , Some ( msg) ) ,
499
503
ProcMacroProgress :: End ( proc_macro_load_result) => {
504
+ self . fetch_proc_macros_queue . op_completed ( true ) ;
500
505
self . set_proc_macros ( proc_macro_load_result) ;
501
506
502
507
( Some ( Progress :: End ) , None )
@@ -649,7 +654,7 @@ impl GlobalState {
649
654
650
655
dispatcher
651
656
. 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 )
653
658
. on_sync_mut :: < lsp_ext:: MemoryUsage > ( handlers:: handle_memory_usage)
654
659
. on_sync_mut :: < lsp_ext:: ShuffleCrateGraph > ( handlers:: handle_shuffle_crate_graph)
655
660
. on_sync :: < lsp_ext:: JoinLines > ( handlers:: handle_join_lines)
@@ -904,7 +909,7 @@ impl GlobalState {
904
909
if let Some ( abs_path) = vfs_path. as_path ( ) {
905
910
if reload:: should_refresh_for_change ( abs_path, ChangeKind :: Modify ) {
906
911
this. fetch_workspaces_queue
907
- . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) ) ;
912
+ . request_op ( format ! ( "DidSaveTextDocument {}" , abs_path. display( ) ) , ( ) ) ;
908
913
}
909
914
}
910
915
@@ -980,7 +985,7 @@ impl GlobalState {
980
985
config. workspace_roots . extend ( added) ;
981
986
if !config. has_linked_projects ( ) && config. detached_files ( ) . is_empty ( ) {
982
987
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 ( ) , ( ) )
984
989
}
985
990
986
991
Ok ( ( ) )
0 commit comments