From 41351e9200bf4e749636f626ee80a12c0f3ea1d7 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 b6182f8aab17..652106bd2ee1 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 5540c5182944..ef4918539a54 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