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
An important optimization in the formatter is that it will format a
subtree of the Piece tree separately and weave the result back into the
parent Solution when possible. Part of that process is adding in any
bound states, overflow characters, and costs determined in the subtree.
Surprisingly, those rarely actually come into play in terms of affecting
the outermost winning solution. I'm not sure exactly why, but if you
just merge in the subtree solution's text and discard the bound states,
overflow, and cost... all the tests still pass.
But after testing on a large corpus, it turns out that in more complex
real-world examples, it *is* important to copy that data back over. So
I grabbed an example whose formatting was affected and added this as a
sort of regression test.
0 commit comments