Sometimes metaprogramming (macros etc) is a useful technique for refactoring, simply because you can try and then discard different designs: https://blog.metaobject.com/2018/11/refactoring-towards-language.html
(I've certainly written then thrown away macros when writing Lisp!)
Related Posts
I've written difftastic packaging instructions: https://difftastic.wilfred.me.uk/packaging_difftastic.html
The different distros have taken different approaches, so I'm trying to help with common gotchas — don't forget the man page!
Feedback welcome, especially if you've ever packaged something 🙂
It feels like rename is by far the most important refactoring operation. If I had an IDE with only one refactoring, I think I'd want rename.
ASTs typically discard comments, and that's usually what you want.
The only time (AFAICS) that preserving comments is useful is for writing a code formatter.
Could you write a formatter in terms of a list of lexemes? A CST is a non-trivial bit of code for one use case.