diff options
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index d0cc1b61a..e51532d88 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -100,10 +100,6 @@ impl GlobalState { | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | pub(crate) fn report_new_status_if_needed(&mut self) { | 102 | pub(crate) fn report_new_status_if_needed(&mut self) { |
103 | if !self.config.server_status_notification() { | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | let mut status = lsp_ext::ServerStatusParams { | 103 | let mut status = lsp_ext::ServerStatusParams { |
108 | health: lsp_ext::Health::Ok, | 104 | health: lsp_ext::Health::Ok, |
109 | quiescent: self.is_quiescent(), | 105 | quiescent: self.is_quiescent(), |
@@ -129,7 +125,14 @@ impl GlobalState { | |||
129 | 125 | ||
130 | if self.last_reported_status.as_ref() != Some(&status) { | 126 | if self.last_reported_status.as_ref() != Some(&status) { |
131 | self.last_reported_status = Some(status.clone()); | 127 | self.last_reported_status = Some(status.clone()); |
132 | self.send_notification::<lsp_ext::ServerStatusNotification>(status); | 128 | |
129 | if let (lsp_ext::Health::Error, Some(message)) = (status.health, &status.message) { | ||
130 | self.show_message(lsp_types::MessageType::Error, message.clone()); | ||
131 | } | ||
132 | |||
133 | if self.config.server_status_notification() { | ||
134 | self.send_notification::<lsp_ext::ServerStatusNotification>(status); | ||
135 | } | ||
133 | } | 136 | } |
134 | } | 137 | } |
135 | 138 | ||
@@ -225,7 +228,6 @@ impl GlobalState { | |||
225 | 228 | ||
226 | if let Some(error_message) = self.fetch_workspace_error() { | 229 | if let Some(error_message) = self.fetch_workspace_error() { |
227 | log::error!("failed to switch workspaces: {}", error_message); | 230 | log::error!("failed to switch workspaces: {}", error_message); |
228 | self.show_message(lsp_types::MessageType::Error, error_message); | ||
229 | if !self.workspaces.is_empty() { | 231 | if !self.workspaces.is_empty() { |
230 | return; | 232 | return; |
231 | } | 233 | } |
@@ -233,7 +235,6 @@ impl GlobalState { | |||
233 | 235 | ||
234 | if let Some(error_message) = self.build_data_error() { | 236 | if let Some(error_message) = self.build_data_error() { |
235 | log::error!("failed to switch build data: {}", error_message); | 237 | log::error!("failed to switch build data: {}", error_message); |
236 | self.show_message(lsp_types::MessageType::Error, error_message); | ||
237 | } | 238 | } |
238 | 239 | ||
239 | let workspaces = self | 240 | let workspaces = self |