Skip to content

FormatASTAsync loses single quotes for characters #3076

@ErikSchierboom

Description

@ErikSchierboom

I've been using FormatASTAsync to format my code, but I found out that it is removed the single quotes from characters.

let code = "let x = 'A'"
let tree, _ = parseFile false (SourceText.ofString code) []    
let formattedCode = CodeFormatter.FormatASTAsync(tree) |> Async.RunSynchronously

I've also tried:

let code = "let x = 'A'"
let [|(tree,_)|] = CodeFormatter.ParseAsync(false, code) |> Async.RunSynchronously
let formattedCode = CodeFormatter.FormatASTAsync(tree) |> Async.RunSynchronously

But that has the same issue.

I'm using:

  • Fantomas.Core: 6.3.2
  • Fantomas.FCS: 6.3.2
  • FSharp.Core: 8.0.200

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueLong hanging fruit: easy issue to get your feet wet!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions