File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,9 @@ impl GlobalState {
454
454
}
455
455
}
456
456
457
- self . fetch_workspaces_if_needed ( ) ;
457
+ if self . config . cargo_autoreload ( ) {
458
+ self . fetch_workspaces_if_needed ( ) ;
459
+ }
458
460
self . fetch_build_data_if_needed ( ) ;
459
461
460
462
let loop_duration = loop_start. elapsed ( ) ;
@@ -494,7 +496,10 @@ impl GlobalState {
494
496
}
495
497
496
498
RequestDispatcher { req : Some ( req) , global_state : self }
497
- . on_sync :: < lsp_ext:: ReloadWorkspace > ( |s, ( ) | Ok ( s. fetch_workspaces_request ( ) ) ) ?
499
+ . on_sync :: < lsp_ext:: ReloadWorkspace > ( |s, ( ) | {
500
+ self . fetch_workspaces_request ( ) ;
501
+ self . fetch_workspaces_if_needed ( ) ;
502
+ } ) ?
498
503
. on_sync :: < lsp_ext:: JoinLines > ( |s, p| handlers:: handle_join_lines ( s. snapshot ( ) , p) ) ?
499
504
. on_sync :: < lsp_ext:: OnEnter > ( |s, p| handlers:: handle_on_enter ( s. snapshot ( ) , p) ) ?
500
505
. on_sync :: < lsp_types:: request:: Shutdown > ( |s, ( ) | {
Original file line number Diff line number Diff line change @@ -60,11 +60,7 @@ impl GlobalState {
60
60
", "
61
61
)
62
62
) ;
63
- if self . config . cargo_autoreload ( ) {
64
- self . fetch_workspaces_request ( ) ;
65
- } else {
66
- self . transition ( Status :: NeedsReload ) ;
67
- }
63
+ self . fetch_workspaces_request ( ) ;
68
64
69
65
fn is_interesting ( path : & AbsPath , change_kind : ChangeKind ) -> bool {
70
66
const IMPLICIT_TARGET_FILES : & [ & str ] = & [ "build.rs" , "src/main.rs" , "src/lib.rs" ] ;
You can’t perform that action at this time.
0 commit comments