mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +00:00
fix: make let_stmts inserted in inline_call correctly indented
This commit is contained in:
parent
0a8c7841e0
commit
7c94c29648
1 changed files with 4 additions and 6 deletions
|
@ -484,12 +484,10 @@ fn inline(
|
||||||
body = make::block_expr(let_stmts, Some(body.into())).clone_for_update();
|
body = make::block_expr(let_stmts, Some(body.into())).clone_for_update();
|
||||||
}
|
}
|
||||||
} else if let Some(stmt_list) = body.stmt_list() {
|
} else if let Some(stmt_list) = body.stmt_list() {
|
||||||
ted::insert_all(
|
let position = stmt_list.l_curly_token().expect("L_CURLY for StatementList is missing.");
|
||||||
ted::Position::after(
|
let_stmts.into_iter().rev().for_each(|let_stmt| {
|
||||||
stmt_list.l_curly_token().expect("L_CURLY for StatementList is missing."),
|
ted::insert(ted::Position::after(position.clone()), let_stmt.syntax().clone());
|
||||||
),
|
});
|
||||||
let_stmts.into_iter().map(|stmt| stmt.syntax().clone().into()).collect(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let original_indentation = match node {
|
let original_indentation = match node {
|
||||||
|
|
Loading…
Reference in a new issue