fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
772 stars 194 forks source link

Wrongly removed "with" for member on record, PreserveEndOfLine=true #388

Closed jindraivanek closed 5 years ago

jindraivanek commented 5 years ago

Issue created from fantomas-ui

Formatted code gives error: Unexpected keyword 'static' in implementation file

Code

type R = {
    X : int
    } with
    static member Default = {X=0}

Error

type R = {
    X : int
    }
    static member Default = { X = 0 }

Options

Fantomas 2.9.1

Name Value
IndentSpaceNum 4
PageWidth 80
PreserveEndOfLine true
SemicolonAtEndOfLine false
SpaceBeforeArgument true
SpaceBeforeColon true
SpaceAfterComma true
SpaceAfterSemicolon true
IndentOnTryWith false
ReorderOpenDeclaration false
SpaceAroundDelimiter true
StrictMode false
nojaf commented 5 years ago

Not an issue anymore due to removal of PreserveEndOfLine in #434. https://jindraivanek.gitlab.io/fantomas-ui/#?fantomas=preview-trivia&code=C4TwDgpgBASlC8UDeBYAUFTUAaUBcUAlgHbDpZQC+UA7ocABblYDOwAhsIQMZQC2EPgCMIAJygARCADN2AVwA2wBMmzwADJSA&config=N4IgkgdgJgphAuBlADgQwMYwHIFcC2IAXACwA0IACqgOYwDqAllPABZEAcADORQE4wBnGLwBuMAKLQA8gDMAMgwgwiM1ABsh5RDDwN0AezX6IAQXiSoshUpXrNIFBhgAhGDP38Tvavjjwi8Lw4MFpomK7u-ADChsYBQSEOYTAmMvDCMXh4qPHBoU6p6bzaugZGELmJkLAIUhAAKrwAnoysthqJAEowHrC8UshwACIw6GqovKjwDHGEqh35mF76ONAjagy6RZVagXrwALL6sO1CAL5AA