File tree 2 files changed +14
-6
lines changed
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ use crate::{
43
43
to_proto, LspError , Result ,
44
44
} ;
45
45
46
+ pub ( crate ) fn handle_workspace_reload ( state : & mut GlobalState , _: ( ) ) -> Result < ( ) > {
47
+ state. proc_macro_client = None ;
48
+ state. fetch_workspaces_queue . request_op ( "reload workspace request" . to_string ( ) ) ;
49
+ state. fetch_build_data_queue . request_op ( "reload workspace request" . to_string ( ) ) ;
50
+ Ok ( ( ) )
51
+ }
52
+
46
53
pub ( crate ) fn handle_analyzer_status (
47
54
snap : GlobalStateSnapshot ,
48
55
params : lsp_ext:: AnalyzerStatusParams ,
Original file line number Diff line number Diff line change @@ -499,9 +499,13 @@ impl GlobalState {
499
499
self . fetch_workspaces ( cause) ;
500
500
}
501
501
}
502
- if let Some ( cause) = self . fetch_build_data_queue . should_start_op ( ) {
503
- self . fetch_build_data ( cause) ;
502
+
503
+ if !self . fetch_workspaces_queue . op_in_progress ( ) {
504
+ if let Some ( cause) = self . fetch_build_data_queue . should_start_op ( ) {
505
+ self . fetch_build_data ( cause) ;
506
+ }
504
507
}
508
+
505
509
if let Some ( cause) = self . prime_caches_queue . should_start_op ( ) {
506
510
tracing:: debug!( %cause, "will prime caches" ) ;
507
511
let num_worker_threads = self . config . prime_caches_num_threads ( ) ;
@@ -571,14 +575,11 @@ impl GlobalState {
571
575
}
572
576
573
577
RequestDispatcher { req : Some ( req) , global_state : self }
574
- . on_sync_mut :: < lsp_ext:: ReloadWorkspace > ( |s, ( ) | {
575
- s. fetch_workspaces_queue . request_op ( "reload workspace request" . to_string ( ) ) ;
576
- Ok ( ( ) )
577
- } ) ?
578
578
. on_sync_mut :: < lsp_types:: request:: Shutdown > ( |s, ( ) | {
579
579
s. shutdown_requested = true ;
580
580
Ok ( ( ) )
581
581
} ) ?
582
+ . on_sync_mut :: < lsp_ext:: ReloadWorkspace > ( handlers:: handle_workspace_reload) ?
582
583
. on_sync_mut :: < lsp_ext:: MemoryUsage > ( handlers:: handle_memory_usage) ?
583
584
. on_sync_mut :: < lsp_ext:: ShuffleCrateGraph > ( handlers:: handle_shuffle_crate_graph) ?
584
585
. on_sync :: < lsp_ext:: JoinLines > ( handlers:: handle_join_lines) ?
You can’t perform that action at this time.
0 commit comments