Closed ljb closed 3 months ago
Hello, thank you for reporting this issue.
We have seen this problem pop up as well when the indent_size
is 2.
As a workaround there we have wrapped the match expression in parentheses (as a last resort).
I think we could extend this check to ctx.Config.IndentSize - 1
(as seems to be the case for IsIfThenElse _
).
Are you interested in submitting a PR for this?
Issue created from fantomas-online
Code
Result
Problem description
Running version 6.0.1 of Fantomas locally results in a slighly different formating compared to the online version:
Both the code generated by Fantomas online and localy results in the same compilation error. Running
dotnet build
with the .NET SDK 7.0.203 will give the following error:The problem is that the call to
||> createTuple
will be run on the entirematch
-expression when there isn't a newline. When there is a newline, it will only be run against the line above.Adding parenthesis around the entire match expression before calling
createTuple
is a workaround.Extra information
Options
Fantomas main branch at 04/26/2023
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?