Skip to content

Commit c03775e

Browse files
committed
Fix is_quiescent reporting
1 parent 2cb6034 commit c03775e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

crates/rust-analyzer/src/main_loop.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ impl GlobalState {
444444
ProjectWorkspaceProgress::End(workspaces) => {
445445
self.fetch_workspaces_queue.op_completed(Some(workspaces));
446446
if let Err(e) = self.fetch_workspace_error() {
447-
tracing::error!("FetchWorkspaceError:\n{e}")
447+
tracing::error!("FetchWorkspaceError:\n{e}");
448448
}
449449

450450
let old = Arc::clone(&self.workspaces);
@@ -468,7 +468,7 @@ impl GlobalState {
468468
BuildDataProgress::End(build_data_result) => {
469469
self.fetch_build_data_queue.op_completed(build_data_result);
470470
if let Err(e) = self.fetch_build_data_error() {
471-
tracing::error!("FetchBuildDataError:\n{e}")
471+
tracing::error!("FetchBuildDataError:\n{e}");
472472
}
473473

474474
self.switch_workspaces("fetched build data".to_string());
@@ -495,14 +495,14 @@ impl GlobalState {
495495
}
496496
}
497497
}
498-
vfs::loader::Message::Progress { n_total: 0, .. } => {}
499498
vfs::loader::Message::Progress { n_total, n_done, config_version } => {
500499
always!(config_version <= self.vfs_config_version);
501500

502501
self.vfs_progress_config_version = config_version;
503502
self.vfs_progress_n_total = n_total;
504503
self.vfs_progress_n_done = n_done;
505504

505+
// if n_total != 0 {
506506
let state = if n_done == 0 {
507507
Progress::Begin
508508
} else if n_done < n_total {
@@ -517,7 +517,8 @@ impl GlobalState {
517517
Some(format!("{n_done}/{n_total}")),
518518
Some(Progress::fraction(n_done, n_total)),
519519
None,
520-
)
520+
);
521+
// }
521522
}
522523
}
523524
}

crates/rust-analyzer/src/reload.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ pub(crate) enum BuildDataProgress {
5656

5757
impl GlobalState {
5858
pub(crate) fn is_quiescent(&self) -> bool {
59-
!(self.fetch_workspaces_queue.op_in_progress()
59+
!(self.last_reported_status.is_none()
60+
|| self.fetch_workspaces_queue.op_in_progress()
6061
|| self.fetch_build_data_queue.op_in_progress()
6162
|| self.vfs_progress_config_version < self.vfs_config_version
6263
|| self.vfs_progress_n_done < self.vfs_progress_n_total)

0 commit comments

Comments
 (0)