You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letShowShardsCommand=
CommandDefinitionBuilder()
.WithName("show")
.WithDescription("Shows shards in a cluster")
.WithArgument(fun builder ->
builder
.WithName("region")
.WithDescription("Name of the shard region from which shards should be shown")
.IsMandatory(true)
.WithSwitch("-r")
.WithSwitch("-R")|> ignore)
.Build()
Output code
letShowShardsCommand=
CommandDefinitionBuilder().WithName("show").WithDescription("Shows shards in a cluster")
.WithArgument
(fun builder ->
builder.WithName("region").WithDescription("Name of the shard region from which shards should be shown")
.IsMandatory(true).WithSwitch("-r").WithSwitch("-R")|> ignore).Build()
Suggested output code
letShowShardsCommand=
CommandDefinitionBuilder().WithName("show").WithDescription("Shows shards in a cluster")
.WithArgument(fun builder ->
builder.WithName("region").WithDescription("Name of the shard region from which shards should be shown")
.IsMandatory(true).WithSwitch("-r").WithSwitch("-R")|> ignore).Build()
Compiler error
Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized F# Compiler(597)
Fantomas output
The following exception occurs while formatting stdin: Fantomas.FormatConfig+FormatException: Formatted content is not valid F# code
at [email protected](Boolean _arg2) in /home/evenbrenden/src/fantomas/src/Fantomas/FakeHelpers.fs:line 55
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 417
at [email protected](AsyncActivation`1 ctxt) in /home/evenbrenden/src/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 377
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.FSharp.Control.AsyncResult`1.Commit() in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 350
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a](CancellationToken cancellationToken, FSharpAsync`1 computation) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 882
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 890
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1154
at Program.processSourceString(Boolean isFsiFile, String s, FSharpChoice`2 tw, FormatConfig config) in /home/evenbrenden/src/fantomas/src/Fantomas.CoreGlobalTool/Program.fs:line 104
at [email protected](String s, String outFile, FormatConfig config) in /home/evenbrenden/src/fantomas/src/Fantomas.CoreGlobalTool/Program.fs:line 313
I'm not able to tell this apart from #498, so maybe a regression? Reproducible on 3.3.0-beta-002 and current master (cf09a21).
Options
Fantomas Next - 3.3.0-2/27/2020
Name
Value
IndentOnTryWith
false
IndentSpaceNum
4
KeepNewlineAfter
false
MaxIfThenElseShortWidth
40
PageWidth
120
ReorderOpenDeclaration
false
SemicolonAtEndOfLine
false
SpaceAfterComma
true
SpaceAfterSemicolon
true
SpaceAroundDelimiter
true
SpaceBeforeArgument
true
SpaceBeforeColon
false
SpaceBeforeSemicolon
false
StrictMode
false
The text was updated successfully, but these errors were encountered:
Personally I think the formatting of chained method code is really ugly at the moment. I would prefer if it could produce code looking more like the input code which is easily understandable and less like the suggested output code which seems to me to be hard to read.
Personally I think the formatting of chained method code is really ugly at the moment. I would prefer if it could produce code looking more like the input code which is easily understandable and less like the suggested output code which seems to me to be hard to read.
I agree, stacking all the method calls on a single column looks tidier to me too. The suggested output code is the smallest change needed to make this compile (that is, getting the opening parenthesis before the lambda on the right line) compared to the current output.
Issue created from fantomas-ui
Input code
Output code
Suggested output code
Compiler error
Fantomas output
I'm not able to tell this apart from #498, so maybe a regression? Reproducible on 3.3.0-beta-002 and current master (cf09a21).
Options
Fantomas Next - 3.3.0-2/27/2020
IndentOnTryWith
false
IndentSpaceNum
4
KeepNewlineAfter
false
MaxIfThenElseShortWidth
40
PageWidth
120
ReorderOpenDeclaration
false
SemicolonAtEndOfLine
false
SpaceAfterComma
true
SpaceAfterSemicolon
true
SpaceAroundDelimiter
true
SpaceBeforeArgument
true
SpaceBeforeColon
false
SpaceBeforeSemicolon
false
StrictMode
false
The text was updated successfully, but these errors were encountered: