Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stable sort lsp edits #11357

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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