From 05ca252fb51bbbf60433bdd3af55ce14bbd66bfd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Sep 2019 10:05:12 +0300 Subject: remove ast_editor.rs --- crates/ra_assists/src/assists/move_bounds.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/ra_assists/src/assists') diff --git a/crates/ra_assists/src/assists/move_bounds.rs b/crates/ra_assists/src/assists/move_bounds.rs index 1d27832a3..39ff51233 100644 --- a/crates/ra_assists/src/assists/move_bounds.rs +++ b/crates/ra_assists/src/assists/move_bounds.rs @@ -1,11 +1,11 @@ use hir::db::HirDatabase; use ra_syntax::{ - ast::{self, make, AstNode, NameOwner, TypeBoundsOwner}, + ast::{self, edit, make, AstNode, NameOwner, TypeBoundsOwner}, SyntaxElement, SyntaxKind::*, }; -use crate::{ast_editor::AstEditor, Assist, AssistCtx, AssistId}; +use crate::{Assist, AssistCtx, AssistId}; pub(crate) fn move_bounds_to_where_clause(mut ctx: AssistCtx) -> Option { let type_param_list = ctx.node_at_offset::()?; @@ -43,9 +43,8 @@ pub(crate) fn move_bounds_to_where_clause(mut ctx: AssistCtx) (type_param, without_bounds) }); - let mut ast_editor = AstEditor::new(type_param_list.clone()); - ast_editor.replace_descendants(new_params); - ast_editor.into_text_edit(edit.text_edit_builder()); + let new_type_param_list = edit::replace_descendants(&type_param_list, new_params); + edit.replace_ast(type_param_list.clone(), new_type_param_list); let where_clause = { let predicates = type_param_list.type_params().filter_map(build_predicate); -- cgit v1.2.3