From 23fb16a80b635a5c7996fb7b1cf527ae7ced96ea Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Sun, 12 May 2024 16:51:54 +0200 Subject: [PATCH] fix: correctly reset inlay hints when stopping or restarting LSPs for a document --- helix-term/src/commands/typed.rs | 2 ++ helix-view/src/editor.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index f38ae6bba4d4f..a6078305cb63a 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1495,6 +1495,8 @@ fn lsp_stop( for doc in cx.editor.documents_mut() { if let Some(client) = doc.remove_language_server_by_name(ls_name) { doc.clear_diagnostics(Some(client.id())); + doc.reset_all_inlay_hints(); + doc.inlay_hints_oudated = true; } } } diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 5540c5182944e..ef4918539a540 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1356,6 +1356,7 @@ impl Editor { let doc = doc_mut!(self, &doc_id); let diagnostics = Editor::doc_diagnostics(&self.language_servers, &self.diagnostics, doc); doc.replace_diagnostics(diagnostics, &[], None); + doc.reset_all_inlay_hints(); } /// Launch a language server for a given document