gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
16.7k stars 698 forks source link

Formatter: some values are indented incorrectly when piped #2890

Closed MystPi closed 3 months ago

MystPi commented 3 months ago

Using Gleam v1.0.0.

The formatter indents some values incorrectly when they are piped and are part of a comma-separated sequence of values. So far it seems that blocks and lists are affected.

Example:

pub fn main() {
  #(
    1,
    {
        "long enough to need to wrap. blah blah blah blah blah blah blah blah blah"
      }
      |> foo,
    3,
  )
}

I think this must be due to the new formatting style of indenting pipes.

giacomocavalieri commented 3 months ago

@lpil could you assign this to me? Or I will forget to look at it 😆

lpil commented 3 months ago

I'm surprised you can't assign it yourself!

giacomocavalieri commented 3 months ago

It looks like this happens to lists as well!

fun(
  [
      ["wibble wobble", "wibble", "wobble"],
      ["long enough to go over", "line limit"],
    ]
    |> list.concat
)