Skip to content

BasicFormat should not be generating trailing whitespace #1529

Closed
@ahoppen

Description

@ahoppen

SwiftBasicFormat currently sometimes generates trailing whitespace in a line. That’s never what we want. We should rewrite SwiftBasicFormat in a way that fundamentally removes this problem. An implementation paradigm would be:

  • A first pass just gathers information between which tokens spaces or newlines (including any following indentation) should be inserted
  • A second pass will then apply the changes gathered in the first pass to the syntax tree
    • If two spaces should be inserted between tokens (e.g. because the first token requires a trailing space and the next token a leading space), it will only add a single space
    • If a space should be inserted followed by a newline, the space will not be isnerted

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions