I noticed that scala-meta provides transformation functions, but not functions to insert additional code (e.g., import statements, or a method call at every start of a function).
Since all structures (scala.meta.Tree and its children) are immutable, I'm not sure if it possible and how I would achieve this?
Essentially, A new tree structure has to be built based on the original with whatever modifications are desired. Tree.transform allows just such a thing.