I think it looks weird if the extends, etc. clauses hang immediately after the > when the type parameters split.
Since import/export directives use the same piece, this nominally affects them too but in practice it's extremely rare for there to be a newline in an import before any other clauses.
While I was at it, I cleaned up the way we build a piece tree for directives. That's some of the oldest code in the new formatter and was more complex than it needed to be. There was no need to use both an InfixPiece and a ClausesPiece since they do basically the same thing.
I think it looks weird if the
extends
, etc. clauses hang immediately after the>
when the type parameters split.Since import/export directives use the same piece, this nominally affects them too but in practice it's extremely rare for there to be a newline in an import before any other clauses.
While I was at it, I cleaned up the way we build a piece tree for directives. That's some of the oldest code in the new formatter and was more complex than it needed to be. There was no need to use both an InfixPiece and a ClausesPiece since they do basically the same thing.