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.