stable sort lsp edits (#11357)

This commit is contained in:
Pascal Kuthe 2024-07-28 23:22:28 +02:00 committed by GitHub
parent fa13b2bd0d
commit 8e041c99df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -503,7 +503,7 @@ pub mod util {
) -> Transaction { ) -> Transaction {
// Sort edits by start range, since some LSPs (Omnisharp) send them // Sort edits by start range, since some LSPs (Omnisharp) send them
// in reverse order. // 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. // Generate a diff if the edit is a full document replacement.
#[allow(clippy::collapsible_if)] #[allow(clippy::collapsible_if)]

View file

@ -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 // Most language servers will already send them sorted but ensure this is the case to
// avoid errors on our end. // 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 padding_before_inlay_hints = Vec::new();
let mut type_inlay_hints = Vec::new(); let mut type_inlay_hints = Vec::new();