@@ -100,10 +100,6 @@ impl GlobalState {
100
100
}
101
101
}
102
102
pub ( crate ) fn report_new_status_if_needed ( & mut self ) {
103
- if !self . config . server_status_notification ( ) {
104
- return ;
105
- }
106
-
107
103
let mut status = lsp_ext:: ServerStatusParams {
108
104
health : lsp_ext:: Health :: Ok ,
109
105
quiescent : self . is_quiescent ( ) ,
@@ -129,7 +125,14 @@ impl GlobalState {
129
125
130
126
if self . last_reported_status . as_ref ( ) != Some ( & status) {
131
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,15 +228,13 @@ impl GlobalState {
225
228
226
229
if let Some ( error_message) = self . fetch_workspace_error ( ) {
227
230
log:: error!( "failed to switch workspaces: {}" , error_message) ;
228
- self . show_message ( lsp_types:: MessageType :: Error , error_message) ;
229
231
if !self . workspaces . is_empty ( ) {
230
232
return ;
231
233
}
232
234
}
233
235
234
236
if let Some ( error_message) = self . build_data_error ( ) {
235
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
240
let workspaces = self
0 commit comments