aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorPhilipp Mildenberger2024-01-09 01:01:04 +0000
committerGitHub2024-01-09 01:01:04 +0000
commit41ca46cf8ca65dbd98df7e038fc12a272f0c9e2a (patch)
treee222eececda605353414b18921de63a35d8acd1c /helix-term/src/commands
parent46ecc102ba6d6c2e6e707b551e24faa240752c87 (diff)
Initialize diagnostics when opening a document (#8873)
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index f530ce10..208854e8 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1502,7 +1502,7 @@ 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(client.id());
+ doc.clear_diagnostics(Some(client.id()));
}
}
}
@@ -2008,6 +2008,10 @@ fn language(
let id = doc.id();
cx.editor.refresh_language_servers(id);
+ let doc = doc_mut!(cx.editor);
+ let diagnostics =
+ Editor::doc_diagnostics(&cx.editor.language_servers, &cx.editor.diagnostics, doc);
+ doc.replace_diagnostics(diagnostics, &[], None);
Ok(())
}