Skip to content

Commit

Permalink
fix: correctly reset inlay hints when stopping or restarting LSPs for…
Browse files Browse the repository at this point in the history
… a document (helix-editor#10741)
  • Loading branch information
poliorcetics authored and Schuyler Mortimer committed Jul 10, 2024
1 parent ffc7c70 commit 4627713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4627713

Please sign in to comment.