File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ use crate::{
4343 to_proto, LspError , Result ,
4444} ;
4545
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+
4653pub ( crate ) fn handle_analyzer_status (
4754 snap : GlobalStateSnapshot ,
4855 params : lsp_ext:: AnalyzerStatusParams ,
Original file line number Diff line number Diff line change @@ -499,9 +499,13 @@ impl GlobalState {
499499 self . fetch_workspaces ( cause) ;
500500 }
501501 }
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+ }
504507 }
508+
505509 if let Some ( cause) = self . prime_caches_queue . should_start_op ( ) {
506510 tracing:: debug!( %cause, "will prime caches" ) ;
507511 let num_worker_threads = self . config . prime_caches_num_threads ( ) ;
@@ -571,14 +575,11 @@ impl GlobalState {
571575 }
572576
573577 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- } ) ?
578578 . on_sync_mut :: < lsp_types:: request:: Shutdown > ( |s, ( ) | {
579579 s. shutdown_requested = true ;
580580 Ok ( ( ) )
581581 } ) ?
582+ . on_sync_mut :: < lsp_ext:: ReloadWorkspace > ( handlers:: handle_workspace_reload) ?
582583 . on_sync_mut :: < lsp_ext:: MemoryUsage > ( handlers:: handle_memory_usage) ?
583584 . on_sync_mut :: < lsp_ext:: ShuffleCrateGraph > ( handlers:: handle_shuffle_crate_graph) ?
584585 . on_sync :: < lsp_ext:: JoinLines > ( handlers:: handle_join_lines) ?
You can’t perform that action at this time.
0 commit comments