fix: correctly reset inlay hints when stopping or restarting LSPs for a document (#10741)
This commit is contained in:
parent
179673568d
commit
972265640d
2 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue