Skip to content

Inserting a block-comment before a property call chain wraps each chained element #1628

@srawlins

Description

@srawlins

I was surprised by this in the new formatting. Here is an input text:

bool f(bool b, int i) {
  return // Check b.
  b == true || i.isEven;
}

The formatter likes all that code on one line. If I want to add a comment for the i.isEven expression, then it insists on splitting:

bool f(bool b, int i) {
  return // Check b.
  b == true ||
          // Check i.
          i
          .isEven;
}

🤕 Ouch. If this is intentional, I'll trust your research, and you can close.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions