avh4/elm-format

Formatting unspaced operators

jfmengels opened this issue · 2 comments

I (too often) have code like this

Input:

a = f>>.field
b = g|>.field

Actual output (version 0.8.5):

a =
    f >>. field


b =
    g |>. field

Expected output:

a =
    f >> .field


b =
    g |> .field

I think the current behavior was correct for older versions of Elm, where >>. was potentially a valid Elm operator. Since 0.19, the operators are all known, and my thinking is that we could decide to try to end up in a state that it is more likely correct code (but is less agnostic about the operators).

avh4 commented

😆 FYI, you already opened this issue #677

I'm adding a new label for issues that I think are good to do, but that will require complete knowledge of the possible operators (and thus will also require Elm 0.19): full operators list Features that require knowledge of the complete list of defined operators

Ugh, I looked for it too and somehow missed it 😅
Feel free to close whichever!