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

Stroustrup style breaks on nested records #2587

Closed
3 tasks
panmona opened this issue Oct 18, 2022 · 1 comment
Closed
3 tasks

Stroustrup style breaks on nested records #2587

panmona opened this issue Oct 18, 2022 · 1 comment

Comments

@panmona
Copy link
Contributor

panmona commented Oct 18, 2022

Issue created from fantomas-online

Code

let myRecord = {
    Property1 = {
        Value1 = 20
        Value2 = 30
        Value3 = 40
    }
    Property2 = {
        Value1 = 20
        Value2 = 30
        Value3 = 40
    }
}

Result

let myRecord = {
    Property1 =
        {
            Value1 = 20
            Value2 = 30
            Value3 = 40
        }
    Property2 =
        {
            Value1 = 20
            Value2 = 30
            Value3 = 40
        }
}

Problem description

I would expect that the nested sub records are also initialized in the Stroustrup style.

But I'm not sure: Are nested record initializations, included in the Stroustrup style or rather: Do you want this to be part of the Fantomas? I'm not sure what the implications would be.

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas main branch at 2022-10-14T16:59:37Z - 35f093c

    { config with
                MultilineBlockBracketsOnSameColumn = true
                ExperimentalStroustrupStyle = true }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@panmona
Copy link
Contributor Author

panmona commented Jan 9, 2023

This now seems to be fixed thanks to #2687

@panmona panmona closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants