Skip to content

switch-branch with multi-match branch is formatted weirdly #7962

@tx46

Description

@tx46
switch 0 {
  // Something something
  | 0
  // Another something
  | 1 =>
    let foo = 123
    doSomethingInteresting(foo)
}

formats to:

switch 0 {
// Something something
| 0
| // Another something
1 =>
  let foo = 123
  doSomethingInteresting(foo)
}

which likely doesn't match the intention here. in general i dislike that the formatter is throwing my comments around and won't let me place them as i want to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterIssues related to code formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions