diff options
author | Pascal Kuthe | 2023-05-20 19:29:23 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-12-27 06:28:14 +0000 |
commit | 783ff27b1ba901e30dbf9897f4faaeb123bebb12 (patch) | |
tree | 105199d4111ad84613075780d98178f3552f55fe /helix-view/src | |
parent | 515ef17207878b78e4f5eda8bf710fa0aa1eae87 (diff) |
consistent diagnostic sorting
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index b4971c8a..af950a3f 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1240,8 +1240,13 @@ impl Document { true }); - self.diagnostics - .sort_unstable_by_key(|diagnostic| diagnostic.range); + self.diagnostics.sort_unstable_by_key(|diagnostic| { + ( + diagnostic.range, + diagnostic.severity, + diagnostic.language_server_id, + ) + }); // Update the inlay hint annotations' positions, helping ensure they are displayed in the proper place let apply_inlay_hint_changes = |annotations: &mut Rc<[InlineAnnotation]>| { @@ -1738,8 +1743,13 @@ impl Document { }); } self.diagnostics.extend(diagnostics); - self.diagnostics - .sort_unstable_by_key(|diagnostic| diagnostic.range); + self.diagnostics.sort_unstable_by_key(|diagnostic| { + ( + diagnostic.range, + diagnostic.severity, + diagnostic.language_server_id, + ) + }); } pub fn clear_diagnostics(&mut self, language_server_id: usize) { |