about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2023-03-10 10:26:02 +0100
committerLukas Wirth <lukastw97@gmail.com>2023-03-10 10:26:02 +0100
commitc03775e4779bd48a2607cbd04fb0e9d4fa5b92cb (patch)
treea5940d9a1267e8832cdbaeff7c51e78e33f601a7
parent2cb60343ed3774d4645d7d14dff8a1119d3c6785 (diff)
downloadrust-c03775e4779bd48a2607cbd04fb0e9d4fa5b92cb.tar.gz
rust-c03775e4779bd48a2607cbd04fb0e9d4fa5b92cb.zip
Fix is_quiescent reporting
-rw-r--r--crates/rust-analyzer/src/main_loop.rs9
-rw-r--r--crates/rust-analyzer/src/reload.rs3
2 files changed, 7 insertions, 5 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 6b15f6ecd62..dd0804b4398 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -444,7 +444,7 @@ impl GlobalState {
                     ProjectWorkspaceProgress::End(workspaces) => {
                         self.fetch_workspaces_queue.op_completed(Some(workspaces));
                         if let Err(e) = self.fetch_workspace_error() {
-                            tracing::error!("FetchWorkspaceError:\n{e}")
+                            tracing::error!("FetchWorkspaceError:\n{e}");
                         }
 
                         let old = Arc::clone(&self.workspaces);
@@ -468,7 +468,7 @@ impl GlobalState {
                     BuildDataProgress::End(build_data_result) => {
                         self.fetch_build_data_queue.op_completed(build_data_result);
                         if let Err(e) = self.fetch_build_data_error() {
-                            tracing::error!("FetchBuildDataError:\n{e}")
+                            tracing::error!("FetchBuildDataError:\n{e}");
                         }
 
                         self.switch_workspaces("fetched build data".to_string());
@@ -495,7 +495,6 @@ impl GlobalState {
                     }
                 }
             }
-            vfs::loader::Message::Progress { n_total: 0, .. } => {}
             vfs::loader::Message::Progress { n_total, n_done, config_version } => {
                 always!(config_version <= self.vfs_config_version);
 
@@ -503,6 +502,7 @@ impl GlobalState {
                 self.vfs_progress_n_total = n_total;
                 self.vfs_progress_n_done = n_done;
 
+                // if n_total != 0 {
                 let state = if n_done == 0 {
                     Progress::Begin
                 } else if n_done < n_total {
@@ -517,7 +517,8 @@ impl GlobalState {
                     Some(format!("{n_done}/{n_total}")),
                     Some(Progress::fraction(n_done, n_total)),
                     None,
-                )
+                );
+                // }
             }
         }
     }
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
index 4695e874161..fca242d91fd 100644
--- a/crates/rust-analyzer/src/reload.rs
+++ b/crates/rust-analyzer/src/reload.rs
@@ -56,7 +56,8 @@ pub(crate) enum BuildDataProgress {
 
 impl GlobalState {
     pub(crate) fn is_quiescent(&self) -> bool {
-        !(self.fetch_workspaces_queue.op_in_progress()
+        !(self.last_reported_status.is_none()
+            || self.fetch_workspaces_queue.op_in_progress()
             || self.fetch_build_data_queue.op_in_progress()
             || self.vfs_progress_config_version < self.vfs_config_version
             || self.vfs_progress_n_done < self.vfs_progress_n_total)