Closed
Description
Issue created from fantomas-online
Code
match subcategory with
| BuildPhaseSubcategory.Compile
| BuildPhaseSubcategory.Parameter
| BuildPhaseSubcategory.Parse
| BuildPhaseSubcategory.TypeCheck -> true
| BuildPhaseSubcategory.DefaultPhase
| BuildPhaseSubcategory.CodeGen
| BuildPhaseSubcategory.Optimize
| BuildPhaseSubcategory.IlxGen
| BuildPhaseSubcategory.IlGen
| BuildPhaseSubcategory.Output
| BuildPhaseSubcategory.Interactive -> false
| BuildPhaseSubcategory.Internal
// Getting here means the compiler has ICE-d. Let's not pile on by showing the unknownSubcategory assert below.
// Just treat as an unknown-to-LanguageService error.
-> false
| unknownSubcategory ->
Debug.Assert(false, sprintf "Subcategory '%s' could not be correlated with a build phase." unknownSubcategory)
// Recovery is to treat this as a 'build' error. Downstream, the project system and language service will treat this as
// if it came from the build and not the language service.
false
Result
match subcategory with
| BuildPhaseSubcategory.Compile
| BuildPhaseSubcategory.Parameter
| BuildPhaseSubcategory.Parse
| BuildPhaseSubcategory.TypeCheck -> true
| BuildPhaseSubcategory.DefaultPhase
| BuildPhaseSubcategory.CodeGen
| BuildPhaseSubcategory.Optimize
| BuildPhaseSubcategory.IlxGen
| BuildPhaseSubcategory.IlGen
| BuildPhaseSubcategory.Output
| BuildPhaseSubcategory.Interactive -> false
| BuildPhaseSubcategory.Internal
// Getting here means the compiler has ICE-d. Let's not pile on by showing the unknownSubcategory assert below.
// Just treat as an unknown-to-LanguageService error.
-> false
| unknownSubcategory ->
Debug.Assert(false, sprintf "Subcategory '%s' could not be correlated with a build phase." unknownSubcategory)
// Recovery is to treat this as a 'build' error. Downstream, the project system and language service will treat this as
// if it came from the build and not the language service.
false
Problem description
There should be at least a single space before -> false
, it currently leads to invalid code.
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.
- I would like a release if this problem is solved.
Options
Fantomas main branch at 2023-05-30T07:57:23Z - a6cf0bb
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.