Skip to content
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

Leading | in single-case union type with access modifier #889

Closed
iblazhko opened this issue Jun 5, 2020 · 2 comments · Fixed by #948
Closed

Leading | in single-case union type with access modifier #889

iblazhko opened this issue Jun 5, 2020 · 2 comments · Fixed by #948
Labels
good first issue Long hanging fruit: easy issue to get your feet wet!

Comments

@iblazhko
Copy link

iblazhko commented Jun 5, 2020

Issue created from fantomas-online

Single case union type with access modifier has leading | after formatting.
I do not see an option to suppress that. For the example below I expect the formatted output to be the same as the input.

If I remove private access modifier, there is no leading | in the output.

Code

open System

type String50 = private String50 of string

Result

open System

type String50 = private | String50 of string

Options

Fantomas Master at 06/02/2020 18:39:46 - eee0f32

Name Value
IndentSpaceNum 4
PageWidth 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation false
SpaceBeforeClassConstructor false
SpaceBeforeMember false
SpaceBeforeColon false
SpaceAfterComma true
SpaceBeforeSemicolon false
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxLetBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
KeepIfThenInSameLine false
StrictMode true
@nojaf
Copy link
Contributor

nojaf commented Jun 5, 2020

Hmm, this is related to #561.
There the pipe was necessary, here we might be able to drop the pipe because of the of string part.

@nojaf
Copy link
Contributor

nojaf commented Jun 9, 2020

@iblazhko could I persuade you to give this a shot yourself?
The AST indicates that there are fields in the union case.

So I think the check of hasVerticalBar can be simplified and should not take access modifiers into account.

If you watch this video you will get an idea of how to get your feet wet in the code base.

@nojaf nojaf added the good first issue Long hanging fruit: easy issue to get your feet wet! label Jun 9, 2020
@nojaf nojaf closed this as completed in #948 Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Long hanging fruit: easy issue to get your feet wet!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants