From 3a202c47362cd1b5066e734425aad02589c0c389 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:07:01 +0530 Subject: [PATCH 01/10] remove edit_in_place from replace_let_with_if_let assist with edit::AstNodeEdit --- .../ide-assists/src/handlers/replace_let_with_if_let.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs index b95e9b52b053..98c1cd9b8a37 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs @@ -1,7 +1,7 @@ use ide_db::ty_filter::TryEnum; use syntax::{ AstNode, T, - ast::{self, edit::IndentLevel, edit_in_place::Indent, syntax_factory::SyntaxFactory}, + ast::{self, edit::{AstNodeEdit, IndentLevel}, syntax_factory::SyntaxFactory}, }; use crate::{AssistContext, AssistId, Assists}; @@ -64,7 +64,7 @@ pub(crate) fn replace_let_with_if_let(acc: &mut Assists, ctx: &AssistContext<'_> if let_expr_needs_paren(&init) { make.expr_paren(init).into() } else { init }; let block = make.block_expr([], None); - block.indent(IndentLevel::from_node(let_stmt.syntax())); + let block = block.indent(IndentLevel::from_node(let_stmt.syntax())); let if_expr = make.expr_if( make.expr_let(pat, init_expr).into(), block, From 28bf2dbb130e175113255ee3223953b7b04158a6 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:11:19 +0530 Subject: [PATCH 02/10] remove edit_in_place from move_const_to_impl assist with edit::AstNodeEdit --- .../crates/ide-assists/src/handlers/move_const_to_impl.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs index 102d7e6d532c..f78b9e5931d6 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs @@ -2,7 +2,7 @@ use hir::{AsAssocItem, AssocItemContainer, FileRange, HasSource}; use ide_db::{assists::AssistId, defs::Definition, search::SearchScope}; use syntax::{ SyntaxKind, - ast::{self, AstNode, edit::IndentLevel, edit_in_place::Indent}, + ast::{self, AstNode, edit::{AstNodeEdit, IndentLevel}}, }; use crate::assist_context::{AssistContext, Assists}; @@ -136,7 +136,8 @@ pub(crate) fn move_const_to_impl(acc: &mut Assists, ctx: &AssistContext<'_>) -> let indent = IndentLevel::from_node(parent_fn.syntax()); let const_ = const_.clone_for_update(); - const_.reindent_to(indent); + let const_ = const_.reset_indent(); + let const_ = const_.indent(indent); builder.insert(insert_offset, format!("\n{indent}{const_}{fixup}")); }, ) From 6221b39591b2db8d1472cded851e378d32668579 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:13:35 +0530 Subject: [PATCH 03/10] remove edit_in_place from bind_unused_param assist with edit::AstNodeEdit --- .../crates/ide-assists/src/handlers/bind_unused_param.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/bind_unused_param.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/bind_unused_param.rs index 771e80bb9231..0e85a77822be 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/bind_unused_param.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/bind_unused_param.rs @@ -2,7 +2,7 @@ use crate::assist_context::{AssistContext, Assists}; use ide_db::{LineIndexDatabase, assists::AssistId, defs::Definition}; use syntax::{ AstNode, - ast::{self, HasName, edit_in_place::Indent}, + ast::{self, HasName, edit::AstNodeEdit}, }; // Assist: bind_unused_param From 5de304e2a4f52ef06318d7e59140a8a7e34377a1 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:15:47 +0530 Subject: [PATCH 04/10] remove edit_in_place from generate_mut_trait_impl assist with edit::AstNodeEdit --- .../ide-assists/src/handlers/generate_mut_trait_impl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs index 53f6f4883f4d..3a62a8853e3a 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs @@ -1,7 +1,7 @@ use ide_db::{famous_defs::FamousDefs, traits::resolve_target_trait}; use syntax::{ AstNode, SyntaxElement, SyntaxNode, T, - ast::{self, edit::AstNodeEdit, edit_in_place::Indent, syntax_factory::SyntaxFactory}, + ast::{self, edit::AstNodeEdit, syntax_factory::SyntaxFactory}, syntax_editor::{Element, Position, SyntaxEditor}, }; @@ -46,7 +46,7 @@ use crate::{AssistContext, AssistId, Assists}; // ``` pub(crate) fn generate_mut_trait_impl(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> { let impl_def = ctx.find_node_at_offset::()?; - let indent = Indent::indent_level(&impl_def); + let indent = impl_def.indent_level(); let ast::Type::PathType(path) = impl_def.trait_()? else { return None; @@ -78,7 +78,7 @@ pub(crate) fn generate_mut_trait_impl(acc: &mut Assists, ctx: &AssistContext<'_> let new_impl = ast::Impl::cast(new_root.clone()).unwrap(); - Indent::indent(&new_impl, indent); + let new_impl = new_impl.indent(indent); let mut editor = edit.make_editor(impl_def.syntax()); editor.insert_all( From 34eee0c30a657269bf95bbd3207eba75d53c1bf9 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:16:50 +0530 Subject: [PATCH 05/10] remove edit_in_place from generate_getter_or_setter assist with edit::AstNodeEdit --- .../ide-assists/src/handlers/generate_getter_or_setter.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs index 2db5e46bb093..84a6f9e8b28c 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs @@ -3,8 +3,7 @@ use stdx::{format_to, to_lower_snake_case}; use syntax::{ TextRange, ast::{ - self, AstNode, HasGenericParams, HasName, HasVisibility, edit_in_place::Indent, - syntax_factory::SyntaxFactory, + self, AstNode, HasGenericParams, HasName, HasVisibility, edit::AstNodeEdit, syntax_factory::SyntaxFactory }, syntax_editor::Position, }; @@ -434,7 +433,7 @@ fn build_source_change( } }; let new_fn = method.clone_for_update(); - new_fn.indent(1.into()); + let new_fn = new_fn.indent(1.into()); new_fn.into() }) .collect(); From 96d6a3e0773ffcc1f3aeea3ee7dab9968a88071a Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 12:20:42 +0530 Subject: [PATCH 06/10] remove edit_in_place from convert_let_else_to_match assist with edit::AstNodeEdit --- .../ide-assists/src/handlers/convert_let_else_to_match.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_let_else_to_match.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_let_else_to_match.rs index ebfed9f9ca99..d2336a4a5d8d 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_let_else_to_match.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_let_else_to_match.rs @@ -1,7 +1,6 @@ use syntax::T; use syntax::ast::RangeItem; -use syntax::ast::edit::IndentLevel; -use syntax::ast::edit_in_place::Indent; +use syntax::ast::edit::AstNodeEdit; use syntax::ast::syntax_factory::SyntaxFactory; use syntax::ast::{self, AstNode, HasName, LetStmt, Pat}; @@ -93,7 +92,8 @@ pub(crate) fn convert_let_else_to_match(acc: &mut Assists, ctx: &AssistContext<' ); let else_arm = make.match_arm(make.wildcard_pat().into(), None, else_expr); let match_ = make.expr_match(init, make.match_arm_list([binding_arm, else_arm])); - match_.reindent_to(IndentLevel::from_node(let_stmt.syntax())); + let match_ = match_.reset_indent(); + let match_ = match_.indent(let_stmt.indent_level()); if bindings.is_empty() { editor.replace(let_stmt.syntax(), match_.syntax()); From c8e284bf017db659ee1b7f5b6df1d967868fd2bf Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 13:01:50 +0530 Subject: [PATCH 07/10] remove edit_in_place from replace_if_let_with_match assist with edit::AstNodeEdit --- .../src/handlers/generate_getter_or_setter.rs | 3 +- .../src/handlers/move_const_to_impl.rs | 5 +- .../src/handlers/replace_if_let_with_match.rs | 62 ++++++++++--------- .../src/handlers/replace_let_with_if_let.rs | 6 +- 4 files changed, 43 insertions(+), 33 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs index 84a6f9e8b28c..51b967437b56 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_getter_or_setter.rs @@ -3,7 +3,8 @@ use stdx::{format_to, to_lower_snake_case}; use syntax::{ TextRange, ast::{ - self, AstNode, HasGenericParams, HasName, HasVisibility, edit::AstNodeEdit, syntax_factory::SyntaxFactory + self, AstNode, HasGenericParams, HasName, HasVisibility, edit::AstNodeEdit, + syntax_factory::SyntaxFactory, }, syntax_editor::Position, }; diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs index f78b9e5931d6..b3e79e4663e9 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_const_to_impl.rs @@ -2,7 +2,10 @@ use hir::{AsAssocItem, AssocItemContainer, FileRange, HasSource}; use ide_db::{assists::AssistId, defs::Definition, search::SearchScope}; use syntax::{ SyntaxKind, - ast::{self, AstNode, edit::{AstNodeEdit, IndentLevel}}, + ast::{ + self, AstNode, + edit::{AstNodeEdit, IndentLevel}, + }, }; use crate::assist_context::{AssistContext, Assists}; diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_if_let_with_match.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_if_let_with_match.rs index b7e5344712eb..915dd3ffcaf0 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_if_let_with_match.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_if_let_with_match.rs @@ -3,7 +3,11 @@ use std::iter::successors; use ide_db::{RootDatabase, defs::NameClass, ty_filter::TryEnum}; use syntax::{ AstNode, Edition, SyntaxKind, T, TextRange, - ast::{self, HasName, edit::IndentLevel, edit_in_place::Indent, syntax_factory::SyntaxFactory}, + ast::{ + self, HasName, + edit::{AstNodeEdit, IndentLevel}, + syntax_factory::SyntaxFactory, + }, syntax_editor::SyntaxEditor, }; @@ -54,8 +58,7 @@ pub(crate) fn replace_if_let_with_match(acc: &mut Assists, ctx: &AssistContext<' ast::ElseBranch::IfExpr(expr) => Some(expr), ast::ElseBranch::Block(block) => { let block = unwrap_trivial_block(block).clone_for_update(); - block.reindent_to(IndentLevel(1)); - else_block = Some(block); + else_block = Some(block.reset_indent().indent(IndentLevel(1))); None } }); @@ -82,12 +85,13 @@ pub(crate) fn replace_if_let_with_match(acc: &mut Assists, ctx: &AssistContext<' (Some(pat), guard) } }; - if let Some(guard) = &guard { - guard.dedent(indent); - guard.indent(IndentLevel(1)); - } - let body = if_expr.then_branch()?.clone_for_update(); - body.indent(IndentLevel(1)); + let guard = if let Some(guard) = &guard { + Some(guard.dedent(indent).indent(IndentLevel(1))) + } else { + guard + }; + + let body = if_expr.then_branch()?.clone_for_update().indent(IndentLevel(1)); cond_bodies.push((cond, guard, body)); } @@ -109,7 +113,8 @@ pub(crate) fn replace_if_let_with_match(acc: &mut Assists, ctx: &AssistContext<' let else_arm = make_else_arm(ctx, &make, else_block, &cond_bodies); let make_match_arm = |(pat, guard, body): (_, Option, ast::BlockExpr)| { - body.reindent_to(IndentLevel::single()); + // Dedent from original position, then indent for match arm + let body = body.dedent(indent).indent(IndentLevel::single()); let body = unwrap_trivial_block(body); match (pat, guard.map(|it| make.match_guard(it))) { (Some(pat), guard) => make.match_arm(pat, guard, body), @@ -122,8 +127,8 @@ pub(crate) fn replace_if_let_with_match(acc: &mut Assists, ctx: &AssistContext<' } }; let arms = cond_bodies.into_iter().map(make_match_arm).chain([else_arm]); - let match_expr = make.expr_match(scrutinee_to_be_expr, make.match_arm_list(arms)); - match_expr.indent(indent); + let match_expr = + make.expr_match(scrutinee_to_be_expr, make.match_arm_list(arms)).indent(indent); match_expr.into() }; @@ -131,10 +136,9 @@ pub(crate) fn replace_if_let_with_match(acc: &mut Assists, ctx: &AssistContext<' if_expr.syntax().parent().is_some_and(|it| ast::IfExpr::can_cast(it.kind())); let expr = if has_preceding_if_expr { // make sure we replace the `else if let ...` with a block so we don't end up with `else expr` - match_expr.dedent(indent); - match_expr.indent(IndentLevel(1)); - let block_expr = make.block_expr([], Some(match_expr)); - block_expr.indent(indent); + let block_expr = make + .block_expr([], Some(match_expr.dedent(indent).indent(IndentLevel(1)))) + .indent(indent); block_expr.into() } else { match_expr @@ -267,10 +271,7 @@ pub(crate) fn replace_match_with_if_let(acc: &mut Assists, ctx: &AssistContext<' // wrap them in another BlockExpr. match expr { ast::Expr::BlockExpr(block) if block.modifier().is_none() => block, - expr => { - expr.indent(IndentLevel(1)); - make.block_expr([], Some(expr)) - } + expr => make.block_expr([], Some(expr.indent(IndentLevel(1)))), } }; @@ -292,18 +293,19 @@ pub(crate) fn replace_match_with_if_let(acc: &mut Assists, ctx: &AssistContext<' } else { condition }; - let then_expr = then_expr.clone_for_update(); - let else_expr = else_expr.clone_for_update(); - then_expr.reindent_to(IndentLevel::single()); - else_expr.reindent_to(IndentLevel::single()); + let then_expr = + then_expr.clone_for_update().reset_indent().indent(IndentLevel::single()); + let else_expr = + else_expr.clone_for_update().reset_indent().indent(IndentLevel::single()); let then_block = make_block_expr(then_expr); let else_expr = if is_empty_expr(&else_expr) { None } else { Some(else_expr) }; - let if_let_expr = make.expr_if( - condition, - then_block, - else_expr.map(make_block_expr).map(ast::ElseBranch::Block), - ); - if_let_expr.indent(IndentLevel::from_node(match_expr.syntax())); + let if_let_expr = make + .expr_if( + condition, + then_block, + else_expr.map(make_block_expr).map(ast::ElseBranch::Block), + ) + .indent(IndentLevel::from_node(match_expr.syntax())); let mut editor = builder.make_editor(match_expr.syntax()); editor.replace(match_expr.syntax(), if_let_expr.syntax()); diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs index 98c1cd9b8a37..15977c420e64 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_let_with_if_let.rs @@ -1,7 +1,11 @@ use ide_db::ty_filter::TryEnum; use syntax::{ AstNode, T, - ast::{self, edit::{AstNodeEdit, IndentLevel}, syntax_factory::SyntaxFactory}, + ast::{ + self, + edit::{AstNodeEdit, IndentLevel}, + syntax_factory::SyntaxFactory, + }, }; use crate::{AssistContext, AssistId, Assists}; From 140a039fb7332154f52ccabb06d9b4f015433da9 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 13:09:27 +0530 Subject: [PATCH 08/10] remove edit_in_place from generate_trait_from_impl assist with edit::AstNodeEdit --- .../crates/ide-assists/src/handlers/generate_trait_from_impl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_trait_from_impl.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_trait_from_impl.rs index 56500cf06802..8bc4d50cf6af 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_trait_from_impl.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_trait_from_impl.rs @@ -2,7 +2,7 @@ use crate::assist_context::{AssistContext, Assists}; use ide_db::assists::AssistId; use syntax::{ AstNode, SyntaxKind, T, - ast::{self, HasGenericParams, HasName, HasVisibility, edit_in_place::Indent, make}, + ast::{self, HasGenericParams, HasName, HasVisibility, edit::AstNodeEdit, make}, syntax_editor::{Position, SyntaxEditor}, }; From 85e0c3209e1c627365ca99ec354e1d7f432f36ab Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 13:11:46 +0530 Subject: [PATCH 09/10] remove edit_in_place from convert_bool_to_enum assist with edit::AstNodeEdit --- .../crates/ide-assists/src/handlers/convert_bool_to_enum.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_bool_to_enum.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_bool_to_enum.rs index 1ae5f6491744..434fbbae05c4 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_bool_to_enum.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_bool_to_enum.rs @@ -11,9 +11,10 @@ use ide_db::{ source_change::SourceChangeBuilder, }; use itertools::Itertools; +use syntax::ast::edit::AstNodeEdit; use syntax::{ AstNode, NodeOrToken, SyntaxKind, SyntaxNode, T, - ast::{self, HasName, edit::IndentLevel, edit_in_place::Indent, make}, + ast::{self, HasName, edit::IndentLevel, make}, }; use crate::{ @@ -479,10 +480,9 @@ fn add_enum_def( ctx.sema.scope(name.syntax()).map(|scope| scope.module()) }) .any(|module| module.nearest_non_block_module(ctx.db()) != *target_module); - let enum_def = make_bool_enum(make_enum_pub); let indent = IndentLevel::from_node(&insert_before); - enum_def.reindent_to(indent); + let enum_def = make_bool_enum(make_enum_pub).reset_indent().indent(indent); edit.insert( insert_before.text_range().start(), From c6b1f8ad9a525ccf50886eb0f0ce60d81195f006 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 13 Feb 2026 13:14:06 +0530 Subject: [PATCH 10/10] remove edit_in_place from generate_new assist with edit::AstNodeEdit --- .../crates/ide-assists/src/handlers/generate_new.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_new.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_new.rs index 4b923ab556b8..793211a27b47 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_new.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_new.rs @@ -3,7 +3,7 @@ use ide_db::{ use_trivial_constructor::use_trivial_constructor, }; use syntax::{ - ast::{self, AstNode, HasName, HasVisibility, StructKind, edit_in_place::Indent, make}, + ast::{self, AstNode, HasName, HasVisibility, StructKind, edit::AstNodeEdit, make}, syntax_editor::Position, }; @@ -150,14 +150,14 @@ pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option false, false, ) - .clone_for_update(); - fn_.indent(1.into()); + .clone_for_update() + .indent(1.into()); let mut editor = builder.make_editor(strukt.syntax()); // Get the node for set annotation let contain_fn = if let Some(impl_def) = impl_def { - fn_.indent(impl_def.indent_level()); + let fn_ = fn_.indent(impl_def.indent_level()); if let Some(l_curly) = impl_def.assoc_item_list().and_then(|list| list.l_curly_token()) { @@ -182,9 +182,8 @@ pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option let indent_level = strukt.indent_level(); let body = vec![ast::AssocItem::Fn(fn_)]; let list = make::assoc_item_list(Some(body)); - let impl_def = generate_impl_with_item(&ast::Adt::Struct(strukt.clone()), Some(list)); - - impl_def.indent(strukt.indent_level()); + let impl_def = generate_impl_with_item(&ast::Adt::Struct(strukt.clone()), Some(list)) + .indent(strukt.indent_level()); // Insert it after the adt editor.insert_all(