Hacker News new | ask | show | jobs
by sweetsocks21 1721 days ago
I don't see why it couldn't be cheap if the editor always enforced being structurally valid? Then AST transformations are as fast as modifying a tree. A comment node would just wrap the necessary items and could unwrap them in linear/constant time.

https://twitter.com/dm_0ney/status/1414742962442014720