fix: correctly reset inlay hints when stopping or restarting LSPs for a document (#10741)

pull/10758/merge
Poliorcetics 6 months ago committed by GitHub
parent 179673568d
commit 972265640d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1495,6 +1495,8 @@ fn lsp_stop(
for doc in cx.editor.documents_mut() { for doc in cx.editor.documents_mut() {
if let Some(client) = doc.remove_language_server_by_name(ls_name) { if let Some(client) = doc.remove_language_server_by_name(ls_name) {
doc.clear_diagnostics(Some(client.id())); doc.clear_diagnostics(Some(client.id()));
doc.reset_all_inlay_hints();
doc.inlay_hints_oudated = true;
} }
} }
} }

@ -1356,6 +1356,7 @@ impl Editor {
let doc = doc_mut!(self, &doc_id); let doc = doc_mut!(self, &doc_id);
let diagnostics = Editor::doc_diagnostics(&self.language_servers, &self.diagnostics, doc); let diagnostics = Editor::doc_diagnostics(&self.language_servers, &self.diagnostics, doc);
doc.replace_diagnostics(diagnostics, &[], None); doc.replace_diagnostics(diagnostics, &[], None);
doc.reset_all_inlay_hints();
} }
/// Launch a language server for a given document /// Launch a language server for a given document

Loading…
Cancel
Save