Closed
Description
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