moonbitlang / moonbit-docs

The docs of MoonBit programming language
https://docs.moonbitlang.com
Other
1.07k stars 51 forks source link

moonfmt: Unexpected format with indented comment #197

Closed mizchi closed 1 week ago

mizchi commented 5 months ago

from

trait X {
  xxx() -> Unit
}

impl X for Int with xxx() {
  ()
}
  // xxx
impl X for Bool with xxx() {
  ()
}

to

trait X {
  xxx() -> Unit
}

impl X for Int with xxx() {
  ()
  // xxx
}

impl X for Bool with xxx() { () }

Expected

trait X {
  xxx() -> Unit
}

impl X for Int with xxx() { () }

// xxx
impl X for Bool with xxx() { () }