"rewrite all subtrees that match this pattern" works really well in jetbrains, they call it structure search-and-replace.