fsprojects / fantomas

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

Formatting removes necessary additional closing brackets for multiline interpolated strings #3044

Closed josh-degraw closed 5 months ago

josh-degraw commented 5 months ago

Issue created from fantomas-online

Code

let createPlan (plan: Plan) =
    task {
        let! res =
            client.ExecuteAsync
                $$"""
                insert Plan {
                    PlanId := '{{plan.PlanId}}',
                    DisplayName := '{{plan.DisplayName}}',
                    CreatedDate := <datetime>'{{plan.CreatedDate}}'
                }
            """

        ()
    }

Result

let createPlan (plan: Plan) =
    task {
        let! res =
            client.ExecuteAsync
                $$"""
                insert Plan {
                    PlanId := '{{plan.PlanId}',
                    DisplayName := '{{plan.DisplayName}',
                    CreatedDate := <datetime>'{{plan.CreatedDate}'
                }
            """

        ()
    }

Problem description

Please describe here the Fantomas problem you encountered. Check out our Contribution Guidelines.

Extra information

Options

Fantomas main branch at 2024-02-04T21:27:56Z - f7a9301689ba4807764c65a25f7dac5f6a65aafe

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

josh-degraw commented 5 months ago

I see this is a duplicate of #3012, will close this in favor of discussing there