Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/flip_binexpr.rs')
-rw-r--r--crates/ide-assists/src/handlers/flip_binexpr.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide-assists/src/handlers/flip_binexpr.rs b/crates/ide-assists/src/handlers/flip_binexpr.rs
index 818a868fe3..247e8109ab 100644
--- a/crates/ide-assists/src/handlers/flip_binexpr.rs
+++ b/crates/ide-assists/src/handlers/flip_binexpr.rs
@@ -1,9 +1,9 @@
use syntax::{
- ast::{self, syntax_factory::SyntaxFactory, AstNode, BinExpr},
SyntaxKind, T,
+ ast::{self, AstNode, BinExpr, syntax_factory::SyntaxFactory},
};
-use crate::{AssistContext, AssistId, AssistKind, Assists};
+use crate::{AssistContext, AssistId, Assists};
// Assist: flip_binexpr
//
@@ -43,19 +43,19 @@ pub(crate) fn flip_binexpr(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option
}
acc.add(
- AssistId("flip_binexpr", AssistKind::RefactorRewrite),
+ AssistId::refactor_rewrite("flip_binexpr"),
"Flip binary expression",
op_token.text_range(),
|builder| {
let mut editor = builder.make_editor(&expr.syntax().parent().unwrap());
- let make = SyntaxFactory::new();
+ let make = SyntaxFactory::with_mappings();
if let FlipAction::FlipAndReplaceOp(binary_op) = action {
editor.replace(op_token, make.token(binary_op))
};
editor.replace(lhs.syntax(), rhs.syntax());
editor.replace(rhs.syntax(), lhs.syntax());
editor.add_mappings(make.finish_with_mappings());
- builder.add_file_edits(ctx.file_id(), editor);
+ builder.add_file_edits(ctx.vfs_file_id(), editor);
},
)
}