Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fsprojects/fantomas
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 979fb9db1f4c54e61c6f09f3451e8eccfcfda34f
Choose a base ref
..
head repository: fsprojects/fantomas
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0dc03a2e563ee0c1297b1bfd8f444424d2bee41f
Choose a head ref
Showing with 35 additions and 3 deletions.
  1. +6 −1 CHANGELOG.md
  2. +26 −0 src/Fantomas.Core.Tests/ChainTests.fs
  3. +3 −2 src/Fantomas.Core/CodePrinter.fs
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,15 @@
### Changed
* Update FCS to 'Add trivia to Nullness nodes in SyntaxTree', commit 836d4e0603442d6053c8d439993a022501cae494 [#3118](https://github.com/fsprojects/fantomas/pull/3118)

## 6.3.16 - 2024-10-29

### Fixed
* Idempotency problem when calling multi-line discriminated union with generic type parameter. [#3132](https://github.com/fsprojects/fantomas/issues/3132)

## 6.3.15 - 2024-09-14

### Fixed
* Non needed parentheses are added around lambda call from tuple/members [#3082](https://github.com/fsprojects/fantomas/issues/3082)
* Non needed parentheses are added around lambda call from tuple/members. [#3082](https://github.com/fsprojects/fantomas/issues/3082)

## 6.3.14 - 2024-09-14

26 changes: 26 additions & 0 deletions src/Fantomas.Core.Tests/ChainTests.fs
Original file line number Diff line number Diff line change
@@ -414,3 +414,29 @@ v().w.x.y.z['a'].b
"""
v().w.x.y.z['a'].b
"""

[<Test>]
let ``multiple line type expression with dotget, 3132`` () =
formatSourceString
"""
Animal<
Identifier
>
.Dog(
"Spot"
)
"""
{ config with
MaxDotGetExpressionWidth = 0
MaxLineLength = 10 }
|> prepend newline
|> should
equal
"""
Animal<
Identifier
>
.Dog(
"Spot"
)
"""
5 changes: 3 additions & 2 deletions src/Fantomas.Core/CodePrinter.fs
Original file line number Diff line number Diff line change
@@ -1014,8 +1014,9 @@ let genExpr (e: Expr) =
(coli sepNone leadingChain (fun idx -> genLink (idx = lastIndex)))
(match leadingChain with
| [] -> sepNone
| head :: rest -> genLink false head +> indentSepNlnUnindent (genIndentedLinks false rest))
+> indentSepNlnUnindent (genIndentedLinks false links)
| [ head ] -> genLink false head
| head :: rest -> genLink false head +> indentSepNlnUnindent (genIndentedLinks true rest))
+> indentSepNlnUnindent (genIndentedLinks true links)

| head :: links -> genFirstLinkAndIndentOther head links