File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -175,8 +175,26 @@ pub(crate) fn fixup_syntax(node: &SyntaxNode) -> SyntaxFixups {
175175 ] ) ;
176176 }
177177 } ,
178+ ast:: LoopExpr ( it) => {
179+ if it. loop_body( ) . is_none( ) {
180+ append. insert( node. clone( ) . into( ) , vec![
181+ SyntheticToken {
182+ kind: SyntaxKind :: L_CURLY ,
183+ text: "{" . into( ) ,
184+ range: end_range,
185+ id: EMPTY_ID ,
186+ } ,
187+ SyntheticToken {
188+ kind: SyntaxKind :: R_CURLY ,
189+ text: "}" . into( ) ,
190+ range: end_range,
191+ id: EMPTY_ID ,
192+ } ,
193+ ] ) ;
194+ }
195+ } ,
178196 // FIXME: foo::
179- // FIXME: for, loop, match etc.
197+ // FIXME: for, match etc.
180198 _ => ( ) ,
181199 }
182200 }
@@ -450,6 +468,20 @@ fn foo() {
450468"# ,
451469 expect ! [ [ r#"
452470fn foo () {while __ra_fixup {}}
471+ "# ] ] ,
472+ )
473+ }
474+
475+ #[ test]
476+ fn fixup_loop ( ) {
477+ check (
478+ r#"
479+ fn foo() {
480+ loop
481+ }
482+ "# ,
483+ expect ! [ [ r#"
484+ fn foo () {loop {}}
453485"# ] ] ,
454486 )
455487 }
You can’t perform that action at this time.
0 commit comments