From 972265640d129edf7ab53693628ee6bea470a0e3 Mon Sep 17 00:00:00 2001 From: Poliorcetics Date: Sun, 2 Jun 2024 17:39:48 +0200 Subject: [PATCH] fix: correctly reset inlay hints when stopping or restarting LSPs for a document (#10741) --- 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 b6182f8aa..652106bd2 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 5540c5182..ef4918539 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1356,6 +1356,7 @@ pub fn refresh_doc_language(&mut self, doc_id: DocumentId) { 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