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

MultilineBlockBracketsOnSameColumn: Put inherit keyword in record into newline #854

Merged
merged 5 commits into from
May 27, 2020

Conversation

Bobface
Copy link
Contributor

@Bobface Bobface commented May 21, 2020

Fixes #852

Puts the inherit-keyword into a new line and indents when MultilineBlockBracketsOnSameColumn is enabled. Example:

Code

let a =
    { inherit ProjectPropertiesBase<_>(projectTypeGuids, factoryGuid, targetFrameworkIds, dotNetCoreSDK)
      buildSettings = FSharpBuildSettings()
      targetPlatformData = targetPlatformData }

Result

let a =
    {
        inherit ProjectPropertiesBase<_>(projectTypeGuids, factoryGuid, targetFrameworkIds, dotNetCoreSDK)
        buildSettings = FSharpBuildSettings()
        targetPlatformData = targetPlatformData
    }

At the time of writing this it is not entirely clear if the behaviour this PR implements is intended. Thus it's a draft for now until we know more.

@Bobface
Copy link
Contributor Author

Bobface commented May 26, 2020

@nojaf Ready for review. I implemented it as you suggested in #852:

When empty I would go for:

{ inherit CommunicationUnsuccessfulException(message) }

when not empty:

{
    inherit CommunicationUnsuccessfulException(message)
    SomeA = ThingA
    SomeB = ThingB
}

@Bobface Bobface marked this pull request as ready for review May 26, 2020 13:08
src/Fantomas/CodePrinter.fs Outdated Show resolved Hide resolved
Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add one extra test with

type ServerCannotBeResolvedException =
    inherit CommunicationUnsuccessfulException

    new(message) =
        { inherit CommunicationUnsuccessfulException(message) }

@Bobface
Copy link
Contributor Author

Bobface commented May 27, 2020

@nojaf Added the test.

@nojaf nojaf merged commit 9df884b into fsprojects:master May 27, 2020
@nojaf
Copy link
Contributor

nojaf commented May 27, 2020

@Bobface thanks!

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 this pull request may close these issues.

MultilineBlockBracketsOnSameColumn not working properly when calling base constructors
2 participants