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

Fantomas wraps extra set of parenthesis around parenthesis. #921

Closed
andrew-russell-ps opened this issue Jun 16, 2020 · 2 comments · Fixed by #991
Closed

Fantomas wraps extra set of parenthesis around parenthesis. #921

andrew-russell-ps opened this issue Jun 16, 2020 · 2 comments · Fixed by #991

Comments

@andrew-russell-ps
Copy link

Issue created from fantomas-online

Fantomas is adding an extra set of parenthesis. DataAccess.getById returns a result type. Result.okValue extracts an option type. This is all wrapped in parenthesis, then we are extracting the value with .Value. When we run the formatter, it adds an extra set of parenthesis each time.

Code

let variable =
                (DataAccess.getById moduleName.readData
                         { Id = createObject.Id }
                     |> Result.okValue).Value

Result

let variable =
    ((DataAccess.getById moduleName.readData { Id = createObject.Id }
      |> Result.okValue)).Value

Options

Fantomas Master at 06/13/2020 12:50:29 - f502c77

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
MaxValueBindingWidth 40
MaxFunctionBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
KeepIfThenInSameLine false
StrictMode false
@nojaf
Copy link
Contributor

nojaf commented Jun 16, 2020

I think this bug is related to the changes of FCS 36.
Are you using Fantomas 4.0.0-alpha-009 by any chance?

@andrew-russell-ps
Copy link
Author

Yes

nojaf added a commit to nojaf/fantomas that referenced this issue Aug 7, 2020
@nojaf nojaf linked a pull request Aug 7, 2020 that will close this issue
nojaf added a commit that referenced this issue Aug 10, 2020
* Don't add extra parenthesis for DotGet(Paren(_)), fixes #989

* Added regression test for #921.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants