aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 39a6532d..99d3af18 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -871,6 +871,32 @@ impl Application {
Notification::ProgressMessage(_params) => {
// do nothing
}
+ Notification::Exit => {
+ self.editor.set_status("Language server exited");
+
+ // Clear any diagnostics for documents with this server open.
+ let urls: Vec<_> = self
+ .editor
+ .documents_mut()
+ .filter_map(|doc| {
+ if doc.language_server().map(|server| server.id())
+ == Some(server_id)
+ {
+ doc.set_diagnostics(Vec::new());
+ doc.url()
+ } else {
+ None
+ }
+ })
+ .collect();
+
+ for url in urls {
+ self.editor.diagnostics.remove(&url);
+ }
+
+ // Remove the language server from the registry.
+ self.editor.language_servers.remove_by_id(server_id);
+ }
}
}
Call::MethodCall(helix_lsp::jsonrpc::MethodCall {