Apply edits in sorted order (#4762)
This commit is contained in:
@@ -65,7 +65,11 @@ fn apply_fixes<'a>(
|
||||
continue;
|
||||
}
|
||||
|
||||
for edit in fix.edits() {
|
||||
for edit in fix
|
||||
.edits()
|
||||
.iter()
|
||||
.sorted_unstable_by_key(|edit| edit.start())
|
||||
{
|
||||
// Add all contents from `last_pos` to `fix.location`.
|
||||
let slice = locator.slice(TextRange::new(last_pos.unwrap_or_default(), edit.start()));
|
||||
output.push_str(slice);
|
||||
|
||||
Reference in New Issue
Block a user