diff options
Diffstat (limited to 'crates/assists/src/handlers/reorder_fields.rs')
-rw-r--r-- | crates/assists/src/handlers/reorder_fields.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/assists/src/handlers/reorder_fields.rs b/crates/assists/src/handlers/reorder_fields.rs index 527f457a7..7c0f0f44e 100644 --- a/crates/assists/src/handlers/reorder_fields.rs +++ b/crates/assists/src/handlers/reorder_fields.rs | |||
@@ -47,9 +47,11 @@ fn reorder<R: AstNode>(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
47 | "Reorder record fields", | 47 | "Reorder record fields", |
48 | target, | 48 | target, |
49 | |edit| { | 49 | |edit| { |
50 | let mut rewriter = algo::SyntaxRewriter::default(); | ||
50 | for (old, new) in fields.iter().zip(&sorted_fields) { | 51 | for (old, new) in fields.iter().zip(&sorted_fields) { |
51 | algo::diff(old, new).into_text_edit(edit.text_edit_builder()); | 52 | rewriter.replace(old, new); |
52 | } | 53 | } |
54 | edit.rewrite(rewriter); | ||
53 | }, | 55 | }, |
54 | ) | 56 | ) |
55 | } | 57 | } |