Skip to content

Commit

Permalink
fix: fix immutable tree error
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkurilla committed Nov 12, 2024
1 parent c588849 commit 4216615
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use syntax::{
ast::{self, edit::AstNodeEdit, make, syntax_factory::SyntaxFactory}, syntax_editor::SyntaxEditor,
ast::{self, edit::AstNodeEdit, edit_in_place, make, syntax_factory::SyntaxFactory}, syntax_editor::SyntaxEditor,
AstNode,
};

Expand Down Expand Up @@ -43,10 +43,8 @@ pub(crate) fn add_braces(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<(
let make = SyntaxFactory::new();
let mut editor = builder.make_editor(&expr.syntax());

let block_expr = AstNodeEdit::indent(
&make.block_expr(None, Some(expr.clone())),
AstNodeEdit::indent_level(&expr),
);
let block_expr = make.block_expr(None, Some(expr.clone()));
block_expr.indent(expr.indent_level());

editor.replace(expr.syntax(), block_expr.syntax());

Expand Down

0 comments on commit 4216615

Please # to comment.