File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
- ## [ Unreleased ]
3
+ ## 7.0.2 - 2025-05-27
4
4
5
5
### Changed
6
6
7
7
* Print version at beginning of execution when detailed verbosity is set. [ 3148] ( https://github.com/fsprojects/fantomas/issues/3148 )
8
8
9
9
### Fixed
10
10
11
+ * Anonymous records in interpolated strings. [ #3162 ] ( https://github.com/fsprojects/fantomas/issues/3162 )
11
12
* Preserve backticks in active pattern idents. [ #3126 ] ( https://github.com/fsprojects/fantomas/issues/3126 )
12
13
* New lines are added after comment in measure type. [ #3145 ] ( https://github.com/fsprojects/fantomas/issues/3145 )
13
14
* Idempotency problem with comments in applications on lambda expressions. [ #3128 ] ( https://github.com/fsprojects/fantomas/issues/3128 )
Original file line number Diff line number Diff line change @@ -376,3 +376,31 @@ let x = $$$\"\"\"one {{{1}}} two {{{2}}} three {{{3}}}\"\"\"
376
376
"
377
377
let x = $$$\"\"\" one {{{1}}} two {{{2}}} three {{{3}}}\"\"\"
378
378
"
379
+
380
+ [<Test>]
381
+ let ``anonymous record in interpolated string , 3162`` () =
382
+ formatSourceString
383
+ "
384
+ $\"\"\" { {| Prop = \" XYZ\" |} }\"\"\"
385
+ "
386
+ config
387
+ |> prepend newline
388
+ |> should
389
+ equal
390
+ "
391
+ $\"\"\" { {| Prop = \" XYZ\" |} }\"\"\"
392
+ "
393
+
394
+ [<Test>]
395
+ let ``seq without seq keyword in interpolated string`` () =
396
+ formatSourceString
397
+ "
398
+ $\"\"\" { { 1..3 } }\"\"\"
399
+ "
400
+ config
401
+ |> prepend newline
402
+ |> should
403
+ equal
404
+ "
405
+ $\"\"\" { { 1..3 } }\"\"\"
406
+ "
Original file line number Diff line number Diff line change @@ -1543,8 +1543,17 @@ let genExpr (e: Expr) =
1543
1543
| Choice1Of2 stringNode -> genSingleTextNode stringNode
1544
1544
| Choice2Of2 fillNode ->
1545
1545
fun ctx ->
1546
+ let sep =
1547
+ match fillNode.Expr with
1548
+ | Expr.AnonStructRecord _
1549
+ | Expr.Record _
1550
+ | Expr.Computation _ -> sepSpace
1551
+ | _ -> sepNone
1552
+
1546
1553
let genFill =
1547
- genInterpolatedFillExpr fillNode.Expr
1554
+ sep
1555
+ +> genInterpolatedFillExpr fillNode.Expr
1556
+ +> sep
1548
1557
+> optSingle ( fun format -> sepColonFixed +> genSingleTextNode format) fillNode.Ident
1549
1558
1550
1559
genFill ctx)
You can’t perform that action at this time.
0 commit comments