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
Please describe here fantomas problem you encountered
Code
namespaceFantomasmoduleString =letmerge a b =if la <> lb thenif la > lb then a' else b'
elseif String.length a' < String.length b' then a' else b'
Error
Exception: Unexpected scenario when formatting elseif/elif, please openan issue via https://jindraivanek.gitlab.io/fantomas-ui Stack Trace: at Fantomas.TriviaContext.else if / elif(range rangeOfIfThenElse, Context ctx)
at Fantomas.CodePrinter.genElifOneliner@1211-2.Invoke(Context x)
at Fantomas.CodePrinter.genElifOneliner@1211-3.Invoke(Context x)
at Fantomas.CodePrinter.genElifOneliner@1212-5.Invoke(Context x)
at Fantomas.CodePrinter.genElifOneliner@1213-6.Invoke(Context x)
at Fantomas.CodePrinter.genElifOneliner@1214-8.Invoke(Context x)
at Fantomas.CodePrinter.genElifOneliner@1215-9.Invoke(Context x)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx)
at Fantomas.Context.colPost[T](FSharpFunc`2 f2, FSharpFunc`2 f1, IEnumerable`1 c, FSharpFunc`2 f, Context ctx)
at Fantomas.CodePrinter.genExpr@1324-324.Invoke(Context x)
at Fantomas.Context.atIndentLevel@176-6.Invoke(Context x)
at Fantomas.Context.atIndentLevel(Boolean alsoSetIndent, Int32 level, FSharpFunc`2 f, Context ctx)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.Context.futureNlnCheckMem@412-1.Invoke(Tuple`2 tupledArg)
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at Fantomas.Cache.memoizeBy@91.Invoke(a x)
at Fantomas.Context.futureNlnCheck(FSharpFunc`2 f, Context ctx)
at Fantomas.CodePrinter.genExprSepEqPrependType(ASTContext astContext, FSharpFunc`2 prefix, SynPat pat, SynExpr e, Context ctx)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.CodePrinter.genModuleDecl@331-46.Invoke(Context x)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.CodePrinter.genTrivia@2268-1.Invoke(Context x)
at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx)
at Fantomas.CodePrinter.genImpFile@79-6.Invoke(Context ctx)
at Fantomas.CodeFormatterImpl.formatWith(ParsedInput ast, FSharpList`1 defines, FormatContext formatContext, FormatConfig config)
at Fantomas.CodeFormatterImpl.format@406-1.Invoke(Tuple`2[]_arg1)
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 416
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction)in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109--- End ofstacktracefrompreviouslocationwhereexceptionwasthrown---
at Microsoft.FSharp.Control.AsyncResult`1.Commit()in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 349
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 870
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 1153
at Server.Result.attempt[a](FSharpFunc`2 f)in/build/src/Server/Server.fs:line 24
Options
Fantomas 3.1.0
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
StrictMode
false
The text was updated successfully, but these errors were encountered:
nojaf
added a commit
to nojaf/fantomas
that referenced
this issue
Feb 14, 2020
…lseExpression range (#678)
* Updated month in release notes
* Adding failing test for #675.
* Fix SynExpr.IfThenElse when the else keyword is not included in the elseExpression range. Fixes#675
Issue created from fantomas-ui
Please describe here fantomas problem you encountered
Code
Error
Options
Fantomas 3.1.0
IndentOnTryWith
false
IndentSpaceNum
4
KeepNewlineAfter
false
MaxIfThenElseShortWidth
40
PageWidth
120
ReorderOpenDeclaration
false
SemicolonAtEndOfLine
false
SpaceAfterComma
true
SpaceAfterSemicolon
true
SpaceAroundDelimiter
true
SpaceBeforeArgument
true
SpaceBeforeColon
false
StrictMode
false
The text was updated successfully, but these errors were encountered: