File tree 3 files changed +12
-6
lines changed
src/tools/rust-analyzer/crates/rust-analyzer/src
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ pub(crate) struct GlobalState {
92
92
93
93
// status
94
94
pub ( crate ) shutdown_requested : bool ,
95
- pub ( crate ) last_reported_status : Option < lsp_ext:: ServerStatusParams > ,
95
+ pub ( crate ) last_reported_status : lsp_ext:: ServerStatusParams ,
96
96
97
97
// proc macros
98
98
pub ( crate ) proc_macro_clients : Arc < [ anyhow:: Result < ProcMacroServer > ] > ,
@@ -238,7 +238,11 @@ impl GlobalState {
238
238
mem_docs : MemDocs :: default ( ) ,
239
239
semantic_tokens_cache : Arc :: new ( Default :: default ( ) ) ,
240
240
shutdown_requested : false ,
241
- last_reported_status : None ,
241
+ last_reported_status : lsp_ext:: ServerStatusParams {
242
+ health : lsp_ext:: Health :: Ok ,
243
+ quiescent : true ,
244
+ message : None ,
245
+ } ,
242
246
source_root_config : SourceRootConfig :: default ( ) ,
243
247
local_roots_parent_map : Arc :: new ( FxHashMap :: default ( ) ) ,
244
248
config_errors : Default :: default ( ) ,
Original file line number Diff line number Diff line change @@ -408,7 +408,10 @@ impl GlobalState {
408
408
if self . is_quiescent ( ) {
409
409
let became_quiescent = !was_quiescent;
410
410
if became_quiescent {
411
- if self . config . check_on_save ( None ) && self . config . flycheck_workspace ( None ) {
411
+ if self . config . check_on_save ( None )
412
+ && self . config . flycheck_workspace ( None )
413
+ && !self . fetch_build_data_queue . op_requested ( )
414
+ {
412
415
// Project has loaded properly, kick off initial flycheck
413
416
self . flycheck . iter ( ) . for_each ( |flycheck| flycheck. restart_workspace ( None ) ) ;
414
417
}
@@ -656,8 +659,8 @@ impl GlobalState {
656
659
657
660
fn update_status_or_notify ( & mut self ) {
658
661
let status = self . current_status ( ) ;
659
- if self . last_reported_status . as_ref ( ) != Some ( & status) {
660
- self . last_reported_status = Some ( status. clone ( ) ) ;
662
+ if self . last_reported_status != status {
663
+ self . last_reported_status = status. clone ( ) ;
661
664
662
665
if self . config . server_status_notification ( ) {
663
666
self . send_notification :: < lsp_ext:: ServerStatusNotification > ( status) ;
Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ impl GlobalState {
70
70
/// are ready to do semantic work.
71
71
pub ( crate ) fn is_quiescent ( & self ) -> bool {
72
72
self . vfs_done
73
- && self . last_reported_status . is_some ( )
74
73
&& !self . fetch_workspaces_queue . op_in_progress ( )
75
74
&& !self . fetch_build_data_queue . op_in_progress ( )
76
75
&& !self . fetch_proc_macros_queue . op_in_progress ( )
You can’t perform that action at this time.
0 commit comments