From 0bfd147f0710c5c20558c17ca4e9ba31602bc483 Mon Sep 17 00:00:00 2001 From: nojaf Date: Mon, 9 Mar 2026 17:22:12 +0100 Subject: [PATCH 1/2] Fix space between uppercase function name and parameter When a function name started with an uppercase letter and had a single non-parenthesized parameter (e.g. `let F P = 1`), the formatter incorrectly omitted the space, producing `let FP = 1`. --- src/Fantomas.Core.Tests/LetBindingTests.fs | 10 ++++++++++ src/Fantomas.Core/CodePrinter.fs | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Fantomas.Core.Tests/LetBindingTests.fs b/src/Fantomas.Core.Tests/LetBindingTests.fs index 70bb61dcb..975cf752f 100644 --- a/src/Fantomas.Core.Tests/LetBindingTests.fs +++ b/src/Fantomas.Core.Tests/LetBindingTests.fs @@ -2324,3 +2324,13 @@ let processSnippetLine let lineStr = lines.[line] () """ + +[] +let ``uppercase function name with uppercase parameter should preserve space`` () = + formatSourceString "let F P = 1" config + |> prepend newline + |> should + equal + """ +let F P = 1 +""" diff --git a/src/Fantomas.Core/CodePrinter.fs b/src/Fantomas.Core/CodePrinter.fs index 432a7eef4..6dbbca803 100644 --- a/src/Fantomas.Core/CodePrinter.fs +++ b/src/Fantomas.Core/CodePrinter.fs @@ -2914,7 +2914,8 @@ let genBinding (b: BindingNode) (ctx: Context) : Context = | _, Pattern.Paren _ | _, Pattern.Unit _ -> spaceBefore | _, Pattern.Named _ - | _, Pattern.Wild _ -> true + | _, Pattern.Wild _ + | _, Pattern.LongIdent _ -> true | content, _ -> match List.tryLast content with | None -> false From c46342837656b15aa3487028b9984d968ceed915 Mon Sep 17 00:00:00 2001 From: nojaf Date: Mon, 9 Mar 2026 17:23:51 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0443d1fb..85693622c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [8.0.0-alpha-006] - 2026-03-09 + +### Fixed + +- Space between uppercase function name and uppercase parameter was dropped. [#3264](https://github.com/fsprojects/fantomas/pull/3264) + ## [8.0.0-alpha-005] - 2026-03-09 ### Fixed