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
This is more of a shower thought, but I wanted to write it down somewhere.
Ever since the Dallas rewrite, we can create our own Oak nodes.
What we don't currently do, but totally can, is insert a unique ID for each node.
In CodePrinter, we have a lot of code that tries to format everything on a single line and takes a different code path if it doesn't fit.
We could probably cache the results of a single-line node printing attempt (using that unique ID). This would allow us to easily reuse the result along with the current column.
For example, if we tried to format node#37 at column 12 as a single line, and it didn’t work, we should only attempt to format node#37 again as a single line if the current column is less than 12.
This is more of a shower thought, but I wanted to write it down somewhere.
Ever since the Dallas rewrite, we can create our own Oak nodes.
What we don't currently do, but totally can, is insert a unique ID for each node.
In CodePrinter, we have a lot of code that tries to format everything on a single line and takes a different code path if it doesn't fit.
We could probably cache the results of a single-line node printing attempt (using that unique ID). This would allow us to easily reuse the result along with the current column.
For example, if we tried to format
node#37
at column 12 as a single line, and it didn’t work, we should only attempt to formatnode#37
again as a single line if the current column is less than 12.//cc @josh-degraw @dawedawe
The text was updated successfully, but these errors were encountered: