diff options
| author | bors <bors@rust-lang.org> | 2023-03-08 12:22:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-08 12:22:10 +0000 |
| commit | 6ebbd48ac0ff9b5aba0b6d201ec4e84bb7d7b57c (patch) | |
| tree | 5294b19e44151cea56316f6641f2c95a4849a83c | |
| parent | aff6cb00804ae03ee09c8a6c3e15cfa1ae23b139 (diff) | |
| parent | b4bd27be9072e898b02b123e8a0803f18899ae86 (diff) | |
| download | rust-6ebbd48ac0ff9b5aba0b6d201ec4e84bb7d7b57c.tar.gz rust-6ebbd48ac0ff9b5aba0b6d201ec4e84bb7d7b57c.zip | |
Auto merge of #14283 - Veykril:error-notifs, r=Veykril
Load proc-macros for rustc_private crates If the client support our server status notification there is no need to show the pop up for workspace fetching failures since that's already going to be shown in the status. cc https://github.com/rust-lang/rust-analyzer/issues/14193
| -rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 8 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/reload.rs | 4 |
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 d2797690669..60afb05bd64 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -409,12 +409,12 @@ impl GlobalState { if self.last_reported_status.as_ref() != Some(&status) { self.last_reported_status = Some(status.clone()); - if let (lsp_ext::Health::Error, Some(message)) = (status.health, &status.message) { - self.show_message(lsp_types::MessageType::ERROR, message.clone()); - } - if self.config.server_status_notification() { self.send_notification::<lsp_ext::ServerStatusNotification>(status); + } else { + if let (lsp_ext::Health::Error, Some(message)) = (status.health, &status.message) { + self.show_message(lsp_types::MessageType::ERROR, message.clone()); + } } } diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 1a396bb06a3..2dfbb2ffb97 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -202,7 +202,9 @@ impl GlobalState { tracing::info!(%cause, "will switch workspaces"); if let Err(error_message) = self.fetch_workspace_error() { - self.show_and_log_error(error_message, None); + if !self.config.server_status_notification() { + self.show_and_log_error(error_message, None); + } if !self.workspaces.is_empty() { // It only makes sense to switch to a partially broken workspace // if we don't have any workspace at all yet. |
