Skip to content

Use a safe filename when formatting from CodeFormatter #1279

Closed
@nojaf

Description

When formatting via the core Fantomas library (via CodeFormatter API), the filename Program.fs is not always safe.

Sample:

open System

[<EntryPoint>]
let main argv _ =
    printfn "meh"
    0

We correct this behaviour in the command line tool and FAKE helpers yet when calling this from CodeFormatter we take the filename as is. We should move these checks to createFormatContext.

Related Ionide issue: ionide/ionide-vscode-fsharp#1352.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions