gleam-lang / suggestions

📙 A place for ideas and feedback
26 stars 2 forks source link

Formatting suggestion: Keep desired line breaks #136

Closed sporto closed 3 years ago

sporto commented 3 years ago

For list, function signatures, etc If I add a line break I would like the formatter to respect that and not try to join lines.

Examples:

let a = [
  1,
  2,
  3,
]

I would prefer the formatter not to make convert this to

let a = [1, 2, 3]

Function signatures:

pub fn tuple2(
  codec_a: Codec(a),
  codec_b: Codec(b),
 ) -> Codec(#(a, b)) {

The formatter changes this to

pub fn tuple2(codec_a: Codec(a), codec_b: Codec(b)) -> Codec(#(a, b)) {

Why?

lpil commented 3 years ago

This is a good suggestion! An issue has just been opened in the gleam repo to track this, so I will close this one. Thank you