Fantomas.Core
8.0.0-alpha-015
See the version list below for details.
dotnet add package Fantomas.Core --version 8.0.0-alpha-015
NuGet\Install-Package Fantomas.Core -Version 8.0.0-alpha-015
<PackageReference Include="Fantomas.Core" Version="8.0.0-alpha-015" />
<PackageVersion Include="Fantomas.Core" Version="8.0.0-alpha-015" />
<PackageReference Include="Fantomas.Core" />
paket add Fantomas.Core --version 8.0.0-alpha-015
#r "nuget: Fantomas.Core, 8.0.0-alpha-015"
#:package Fantomas.Core@8.0.0-alpha-015
#addin nuget:?package=Fantomas.Core&version=8.0.0-alpha-015&prerelease
#tool nuget:?package=Fantomas.Core&version=8.0.0-alpha-015&prerelease
Fantomas

An opinionated F# source code formatter.
dotnet tool install fantomas
Documentation is available at https://fsprojects.github.io/fantomas/docs/index.html
If you point a coding agent at Fantomas, give it llms.txt for an index of the documentation, or llms-full.txt for all of it in one file.
Contributing Guidelines
See the Contribution Guidelines and our contributors documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Fantomas.FCS (>= 8.0.0-alpha-015)
- FSharp.Core (>= 10.0.100)
- System.Collections.Immutable (>= 10.0.6)
- System.Diagnostics.DiagnosticSource (>= 10.0.6)
- System.Memory (>= 4.6.3)
- System.Runtime (>= 4.3.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Fantomas.Core:
| Package | Downloads |
|---|---|
|
Myriad.Core
Core Myriad library used for developing plugins |
|
|
Fantomas.Extras
Utility package for Fantomas |
|
|
WoofWare.Whippet.Fantomas
Helpers for accessing Fantomas syntax trees. |
|
|
Fabulous.AST
Fabulous.AST, an Abstract Syntax Tree (AST) Domain Specific Language (DSL) for F#. |
|
|
Partas.Feliz.Generator
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0-alpha-016 | 0 | 8/25/2026 |
| 8.0.0-alpha-015 | 28 | 8/24/2026 |
| 8.0.0-alpha-014 | 46 | 8/20/2026 |
| 8.0.0-alpha-013 | 61 | 8/19/2026 |
| 8.0.0-alpha-012 | 145 | 4/16/2026 |
| 8.0.0-alpha-011 | 123 | 4/15/2026 |
| 8.0.0-alpha-010 | 121 | 4/15/2026 |
| 8.0.0-alpha-009 | 133 | 4/3/2026 |
| 8.0.0-alpha-008 | 143 | 3/25/2026 |
| 8.0.0-alpha-007 | 133 | 3/10/2026 |
| 8.0.0-alpha-006 | 126 | 3/9/2026 |
| 8.0.0-alpha-005 | 122 | 3/9/2026 |
| 8.0.0-alpha-004 | 123 | 3/7/2026 |
| 8.0.0-alpha-003 | 120 | 3/3/2026 |
| 8.0.0-alpha-002 | 3,392 | 12/15/2025 |
| 8.0.0-alpha-001 | 167 | 12/12/2025 |
| 7.0.6 | 532 | 8/19/2026 |
| 7.0.5 | 15,039 | 12/5/2025 |
| 7.0.4 | 281 | 12/5/2025 |
| 7.0.3 | 18,774 | 7/4/2025 |
### Added
- Support for the record spread syntax introduced in F# preview, [RFC FS-1151](https://github.com/fsharp/fslang-design/pull/805). A spread can appear in a record expression, `{ ...source; Field = value }`, in an anonymous record expression, `{ ...source; Field = value }`, and in the record representation of a type definition, `type Target = { ...Source; Field: int }`, in both implementation and signature files. [#3400](https://github.com/fsprojects/fantomas/pull/3400)
- Interpolated strings with a negative alignment, `$"{value,-10}"`, now format instead of failing with a parse error. Alignment and format specifiers keep their existing layout, so `$"{value,10:N2}"` is unaffected. [#3400](https://github.com/fsprojects/fantomas/pull/3400)
- `--json` writes one JSON document to standard out describing what the run did, instead of the usual messages, for a script or an agent that has to act on the result rather than read it. Every file the run looked at is named with a status of `formatted`, `unchanged`, `ignored`, `needs-formatting` or `error`, and a file that failed to parse carries the severity, code, message and one based position of every diagnostic. Paths are reported as they were given, relative to the `workingDirectory` the document carries once. Standard out carries the document and nothing else, so it can be piped straight into a parser, while warnings still go to standard error. Exit codes are unchanged and the document repeats the one the process ends with. Works with `--check`, and is refused alongside `--daemon`, where standard out already carries the JSON-RPC protocol. [#3412](https://github.com/fsprojects/fantomas/pull/3412)
### Changed
- Breaking: warnings and errors are written to standard error instead of standard out. Informational output stays on standard out, including `--version` and the files `--check` reports as needing formatting, so a caller can tell the tool's output apart from its diagnostics by stream. Scripts that capture standard out to detect failures need to capture standard error as well. [#3399](https://github.com/fsprojects/fantomas/pull/3399)
- Update FCS to 'Parser: recover on missing when conditions', commit d05075e098278aedcea3379159504d664628a495 [#3400](https://github.com/fsprojects/fantomas/pull/3400)
- Breaking: the `--help` page is written by Fantomas instead of by Argu. It carries the version, worked examples, what an input path may be, and links to the documentation, the F# Discord and the `llms.txt` files an LLM can read. Colours are used when the terminal supports them and dropped when standard out is redirected. `-h` is now accepted alongside `--help`. An argument error reports the complaint on standard error followed by a pointer to `--help`, where it used to print Argu's usage block. [#3402](https://github.com/fsprojects/fantomas/pull/3402)
- Breaking: a run over a single file reports the path it was given instead of only the file name, so `fantomas src/A.fs` prints `src/A.fs was formatted.` where it printed `A.fs was formatted.`. The same applies to the unchanged, ignored and failure messages. A run over several files already reported the path, so the two now agree. [#3404](https://github.com/fsprojects/fantomas/pull/3404)
- Breaking: a file that cannot be parsed is reported with the position of every diagnostic the parser produced, one MSBuild style line each, followed by a snippet of the source with two lines of context either side and a caret under the offending range. This replaces `Could not parse the file.` for a format run, the `%A` record dump and stack trace for a `--check` run, and the same `%A` dump the daemon used to hand editors. Diagnostics are ordered by position and columns are one based, matching what the F# compiler prints for the same file. [#3405](https://github.com/fsprojects/fantomas/pull/3405)
- Breaking: the messages for an input path Fantomas cannot work with are now the same whether the run formats or checks. `--check` used to report `Input path 'x' is unsupported file type` and `Input path 'x' not found` without a full stop where a format run ended both with one, and a run with no input path at all said `No input path provided.` when checking and `Input path is missing.` when formatting. Both now report `Input path 'x' is an unsupported file type.`, `Input path 'x' not found.` and `No input path provided. Call with --help for usage information.` [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- Breaking: a single file that `.fantomasignore` matches is reported the same way as an ignored file found while walking a folder. `fantomas A.fs` on an ignored file printed nothing unless `--verbosity d` was given, where `fantomas ./folder` containing only that file printed `A.fs was ignored.` Both now print it. A `--check` run reports the files it ignored at detailed verbosity whether they were named directly or found in a folder, where before only a directly named file was reported. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- At detailed verbosity, a run writing to `--out` now notes a file it found already formatted, as a run formatting in place always did. Both paths decide what formatting came to in the same place, so they say the same things about it. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- Breaking: `--daemon` no longer accepts the arguments that mean nothing to a daemon. `--check`, `--out`, `--force`, `--profile`, `--json` and input paths were all accepted and then silently ignored, so `fantomas --daemon ./src` looked like it would format a folder and did not. Any of them now reports which ones were refused and exits 1 without starting. `--verbosity` is still accepted, since it sets the level the daemon logs at, and `--version` wins outright. `Fantomas.Client` launches the daemon with no other arguments, so no editor integration is affected. [#3412](https://github.com/fsprojects/fantomas/pull/3412)
- `--version` now answers whatever else is on the command line, and before any of it is validated, so it can always be used to find out what you are running. It used to be refused alongside `--daemon`, and `fantomas --version -v bogus` exited 1 without printing a version. It is also written straight to standard out instead of through the logger, so it no longer picks up the timestamp and level prefix that `--verbosity d` adds, and reads the same at any verbosity. [#3412](https://github.com/fsprojects/fantomas/pull/3412)
- Breaking: `Fantomas.Core` is no longer binary compatible with `v7`. Several discriminated unions are structs now, which changes nothing about how they are written or matched, but an assembly compiled against `v7` has to be rebuilt. [#3407](https://github.com/fsprojects/fantomas/pull/3407)
- A setting in `.editorconfig` that carries the `fsharp_` prefix but is not a Fantomas setting now warns instead of being silently ignored, and where the intent is obvious the warning names the spelling that works. This catches a misspelling such as `fsharp_multiline_brackets_style`, and catches prefixing one of the four settings editorconfig itself defines, where `fsharp_max_line_length` never applied and `max_line_length` is the one that does. Settings without the `fsharp_` prefix belong to other tools and are left alone. Every problem in one `.editorconfig` is reported together and only once per run, rather than once per formatted file, and `--verbosity d` writes out every setting the running version supports. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
- `.editorconfig` keys and values are both matched without regard to case, as the editorconfig specification defines them. `FSHARP_MAX_RECORD_WIDTH` and `fsharp_experimental_elmish = True` used to be ignored. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
- The daemon sends a `fantomas/configurationWarning` notification for every format request, naming the settings in the resolved configuration it could not act on, and sending an empty list when there are none so an editor can clear what it showed earlier. Additive to the JSON-RPC contract: a client that does not handle the method ignores it and keeps working. See the [Fantomas.Client changelog](https://github.com/fsprojects/fantomas/blob/main/src/Fantomas.Client/CHANGELOG.md) for the client-side API. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
### Fixed
- `--verbosity` with an unrecognised value exited with code 1 and printed nothing, because the message was logged before the logger was configured. It now reports `Invalid verbosity level` on standard error. [#3399](https://github.com/fsprojects/fantomas/pull/3399)
- `--out <folder>` flattened the input tree: every file landed directly in the output folder, so two files with the same name in different subfolders silently overwrote each other. The output folder now mirrors the structure of the input folder, as the documentation already promised. [#3403](https://github.com/fsprojects/fantomas/pull/3403)
- `--out <file>` failed with `Failed to format file` and exit code 1 when the folder of the given path did not exist. Fantomas now creates it, along with the subfolders that mirroring an input folder needs. [#3403](https://github.com/fsprojects/fantomas/pull/3403)
- `--out` naming the input folder under a different spelling, such as `fantomas src --out ./src`, emptied every file it was given. The output file was opened, and therefore truncated, before the input was read. Nothing is written now until formatting has produced the text to write, which also leaves the previous output in place when formatting fails. [#3403](https://github.com/fsprojects/fantomas/pull/3403)
- `--out` pointing inside the input folder, such as `fantomas src --out src/formatted`, formatted the previous run's output again and nested it one folder deeper on every run. The output folder is left out of the input scan. [#3403](https://github.com/fsprojects/fantomas/pull/3403)
- `fantomas src/ --out src` formatted nothing and reported an empty table, where `fantomas src --out src` formatted the folder in place. A trailing separator made the two paths compare as different places, so every file below the input folder was taken for a previous run's output and skipped. The same applied to `fantomas src --out src/`. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- A file whose extension is not lowercase, such as `A.FS`, was refused as an unsupported file type, and one found while walking a folder was skipped. The extension is now compared without case, which is what a volume that ignores case, as macOS and Windows usually do, means by the same file. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- Given several input paths, a folder whose name contains a dot, such as `fantomas my.stuff src`, was taken for a file and reported as `Failed to format file`. A file with no extension was taken for a folder. Which one a path is, is now asked of the file system rather than guessed from the name. A single input path was already classified this way. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- A `.fantomasignore` pattern that cannot be matched against a path reported the raw exception, with its stack trace, through `%A`. It now names the file and the ignore file that could not be told apart, and keeps the exception for detailed verbosity. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- `--profile` reported `Line count: 0` for a file whose line endings are not the ones the platform uses, because it counted occurrences of the platform's newline rather than line breaks. A file saved with line feeds counted nothing on Windows, and one saved with carriage returns counted nothing elsewhere. [#3406](https://github.com/fsprojects/fantomas/pull/3406)
- The daemon held its JSON-RPC message loop while reading an `.editorconfig`, so a request that arrived during it was not read until that finished. It hands the loop back first now, and serves one request at a time per file so that the configuration warnings for a file still arrive in the order the requests did. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
- A value that meant something to one setting decided the outcome for every other setting, because each value was tried against every parser in turn. `fsharp_max_record_width = cr` failed the whole run with `Carriage returns are not valid for F# code`; it is now reported as a value that setting does not accept. A value is only read as the type its own setting has. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
- A misspelling of one of the four settings editorconfig itself defines was silently ignored, where a misspelling of a `fsharp_` setting was reported. `max_line_lenght = 100` now says so. Only names within two edits of a setting Fantomas has are read this way, so settings belonging to other tools, `indent_style` among them, stay silent. [#3401](https://github.com/fsprojects/fantomas/pull/3401)
- A negative number was accepted for any setting that takes one, so `fsharp_max_record_width = -5` formatted to nonsense widths without saying anything. It is now reported like any other value the setting does not accept. [#3401](https://github.com/fsprojects/fantomas/pull/3401)