Skip to content

Commit

Permalink
stable sort lsp edits (helix-editor#11357)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe committed Jul 28, 2024
1 parent fa13b2b commit 8e041c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helix-lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ pub mod util {
) -> Transaction {
// Sort edits by start range, since some LSPs (Omnisharp) send them
// in reverse order.
edits.sort_unstable_by_key(|edit| edit.range.start);
edits.sort_by_key(|edit| edit.range.start);

// Generate a diff if the edit is a full document replacement.
#[allow(clippy::collapsible_if)]
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ fn compute_inlay_hints_for_view(

// Most language servers will already send them sorted but ensure this is the case to
// avoid errors on our end.
hints.sort_unstable_by_key(|inlay_hint| inlay_hint.position);
hints.sort_by_key(|inlay_hint| inlay_hint.position);

let mut padding_before_inlay_hints = Vec::new();
let mut type_inlay_hints = Vec::new();
Expand Down

0 comments on commit 8e041c9

Please sign in to comment.