diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 8ebc90027d80..2ef99c6ad136 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -788,6 +788,8 @@ impl Document { diagnostic.range.end = changes.map_pos(diagnostic.range.end, Assoc::After); diagnostic.line = self.text.char_to_line(diagnostic.range.start); } + self.diagnostics + .sort_unstable_by_key(|diagnostic| diagnostic.range); // emit lsp notification if let Some(language_server) = self.language_server() {