syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Attribute changes the printing line break when it shouldn't

Open chenglou opened this issue 4 years ago • 0 comments

Repro:

@warning("-8")
let [c1, c2, c3, c4, c5] =
  [cards.c1, cards.c2, cards.c3, cards.c4, cards.c5]->Js.Array2.sortInPlaceWith((a, b) =>
    rankToIndex(a.rank) - rankToIndex(b.rank)
  )

Formats into:

@warning
let [c1, c2, c3, c4, c5] = [
  cards.c1,
  cards.c2,
  cards.c3,
  cards.c4,
  cards.c5,
]->Js.Array2.sortInPlaceWith((a, b) => rankToIndex(a.rank) - rankToIndex(b.rank))

Removing the attribute causes it to format the array creation onto a single line. Shouldn't have changed

chenglou avatar Apr 03 '21 13:04 chenglou