File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
crates/ide-assists/src/handlers Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -484,12 +484,10 @@ fn inline(
484484 body = make:: block_expr ( let_stmts, Some ( body. into ( ) ) ) . clone_for_update ( ) ;
485485 }
486486 } else if let Some ( stmt_list) = body. stmt_list ( ) {
487- ted:: insert_all (
488- ted:: Position :: after (
489- stmt_list. l_curly_token ( ) . expect ( "L_CURLY for StatementList is missing." ) ,
490- ) ,
491- let_stmts. into_iter ( ) . map ( |stmt| stmt. syntax ( ) . clone ( ) . into ( ) ) . collect ( ) ,
492- ) ;
487+ let position = stmt_list. l_curly_token ( ) . expect ( "L_CURLY for StatementList is missing." ) ;
488+ let_stmts. into_iter ( ) . rev ( ) . for_each ( |let_stmt| {
489+ ted:: insert ( ted:: Position :: after ( position. clone ( ) ) , let_stmt. syntax ( ) . clone ( ) ) ;
490+ } ) ;
493491 }
494492
495493 let original_indentation = match node {
You can’t perform that action at this time.
0 commit comments