-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipe is removed when DU type name matches record type name #641
Comments
This is by design actually. See https://jindraivanek.gitlab.io/fantomas-ui/#?fantomas=preview&code=C4TwDgpgBAIgqlAvFAPlAShAxgewE4AmQA If preferred you can open a new change request to maybe introduce a setting whether the pipe should be there for single case DUs. |
In my example it becomes a type alias for |
Apologies, I missed the point of the issue I'm afraid 😅 ImplFile
(ParsedImplFileInput
("Script.fsx",true,QualifiedNameOfFile Script$fsx,[],[],
[SynModuleOrNamespace
([Script],false,AnonModule,
[Types
([TypeDefn
(ComponentInfo
([],[],[],[Record],
PreXmlDoc ((1,11),FSharp.Compiler.Ast+XmlDocCollector),
false,None,Script.fsx (1,5--1,11) IsSynthetic=false),
Simple
(Record
(None,
[Field
([],false,Some Name,
LongIdent (LongIdentWithDots ([string],[])),false,
PreXmlDoc
((1,20),FSharp.Compiler.Ast+XmlDocCollector),None,
Script.fsx (1,16--1,28) IsSynthetic=false)],
Script.fsx (1,14--1,30) IsSynthetic=false),
Script.fsx (1,14--1,30) IsSynthetic=false),[],
Script.fsx (1,5--1,30) IsSynthetic=false)],
Script.fsx (1,0--1,30) IsSynthetic=false);
Types
([TypeDefn
(ComponentInfo
([],[],[],[DU],
PreXmlDoc ((2,7),FSharp.Compiler.Ast+XmlDocCollector),false,
None,Script.fsx (2,5--2,7) IsSynthetic=false),
Simple
(Union
(None,
[UnionCase
([],Record,UnionCaseFields [],
PreXmlDoc
((2,11),FSharp.Compiler.Ast+XmlDocCollector),None,
Script.fsx (2,12--2,18) IsSynthetic=false)],
Script.fsx (2,10--2,18) IsSynthetic=false),
Script.fsx (2,10--2,18) IsSynthetic=false),[],
Script.fsx (2,5--2,18) IsSynthetic=false)],
Script.fsx (2,0--2,18) IsSynthetic=false)],PreXmlDocEmpty,[],None,
Script.fsx (1,0--2,18) IsSynthetic=false)],(true, true))) after: ImplFile
(ParsedImplFileInput
("Script.fsx",true,QualifiedNameOfFile Script$fsx,[],[],
[SynModuleOrNamespace
([Script],false,AnonModule,
[Types
([TypeDefn
(ComponentInfo
([],[],[],[Record],
PreXmlDoc ((1,11),FSharp.Compiler.Ast+XmlDocCollector),
false,None,Script.fsx (1,5--1,11) IsSynthetic=false),
Simple
(Record
(None,
[Field
([],false,Some Name,
LongIdent (LongIdentWithDots ([string],[])),false,
PreXmlDoc
((1,20),FSharp.Compiler.Ast+XmlDocCollector),None,
Script.fsx (1,16--1,28) IsSynthetic=false)],
Script.fsx (1,14--1,30) IsSynthetic=false),
Script.fsx (1,14--1,30) IsSynthetic=false),[],
Script.fsx (1,5--1,30) IsSynthetic=false)],
Script.fsx (1,0--1,30) IsSynthetic=false);
Types
([TypeDefn
(ComponentInfo
([],[],[],[DU],
PreXmlDoc ((2,7),FSharp.Compiler.Ast+XmlDocCollector),false,
None,Script.fsx (2,5--2,7) IsSynthetic=false),
Simple
(TypeAbbrev
(Ok,LongIdent (LongIdentWithDots ([Record],[])),
Script.fsx (2,10--2,16) IsSynthetic=false),
Script.fsx (2,10--2,16) IsSynthetic=false),[],
Script.fsx (2,5--2,16) IsSynthetic=false)],
Script.fsx (2,0--2,16) IsSynthetic=false)],PreXmlDocEmpty,[],None,
Script.fsx (1,0--2,16) IsSynthetic=false)],(true, true))) So I guess single case DU without any UnionCaseFields should also have a pipe. Thanks for this report! |
Issue created from fantomas-ui
Pipe is removed when DU type name matches record type name
Code
Result
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: