fantomas icon indicating copy to clipboard operation
fantomas copied to clipboard

Unable to format Fable line (cannot determine if Expr Paren Fantomas.Core.SyntaxOak+ExprParenNode is uppercase or lowercase)

Open cr3wdayt5p opened this issue 1 year ago • 2 comments

Issue created from fantomas-online

Code

let statusBarHeight = (window?getComputedStyle document.documentElement)?getPropertyValue "--statusBarHeight"

Problem description

This valid line of Fable code throws:

System.Exception: cannot determine if Expr Paren Fantomas.Core.SyntaxOak+ExprParenNode is uppercase or lowercase

The issue is present in both 6.2.3 and 6.3.0-alpha-003.

Workaround

let statusBarHeight =
    let docStyle = (window?getComputedStyle document.documentElement)
    docStyle?getPropertyValue "--statusBarHeight"

This minor refactor is no problem for Fantomas.

cr3wdayt5p avatar Nov 23 '23 10:11 cr3wdayt5p

Hey @cr3wdayt5p , thanks for raising the issue. If you want to work on this yourself, I think a good starting poing is here

dawedawe avatar Nov 23 '23 13:11 dawedawe

Looks like the function that @dawedawe mentioned doesn't seem to explicitly know how to handle the )?. Do we not include dynamic expressions in chains?

josh-degraw avatar Nov 23 '23 16:11 josh-degraw