I want to convert part of a PSI tree, but not modify its children. (Specifically
I don't want to lose userData.)
I see that InspectionGadgets quick fixes use PsiElementFactory with getText()
to re-create statements by converting them to text and re-parsing them, for
example when converting foreach statement to for statement.
It seems that there must be a better way - could I copy() the children I
want to re-use?