You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test fails. It involves a multi-line string literal that has a tertiary expression. The string literal needs re-indentation, but parts of the tertiary expression's indentation in the result has wrong indentation level.
The dirty secret right now is that we don't do any formatting of expressions inside string interpolations. So what you're seeing is us just taking the verbatim text inside the interpolation (newlines and leading space included) and printing it back out, which doesn't work if the indentation of the outer string changes.
There were a couple reasons for that decision:
If we're formatting an interpolation inside a single-line string, we don't want to introduce any line breaks. We didn't have controls to disable those originally, but now we do (for #if conditions).
IIRC, the older representation of multiline strings was different and contained embedded newlines, making it harder to reason about. Now that there's a string segment per line and each line will be preceded by indentation that the pretty printer is aware of, it should be easier to have interpolation segments respect that.
The following test fails. It involves a multi-line string literal that has a tertiary expression. The string literal needs re-indentation, but parts of the tertiary expression's indentation in the result has wrong indentation level.
Failure diagnostics:
Note that the formatted result is syntactically invalid.
The text was updated successfully, but these errors were encountered: