logoalt Hacker News

Tareanyesterday at 11:54 PM0 repliesview on HN

Intellij also has structural search and replace, where you can do full subgraph isomorphism search in the code and with patterns like

    $x$.foo($args$)
Where you add filters like x's type is a subclass of some class, and args stands for 0-n arguments.

You can also access the full intellij API via groovy scripts in the filters or when computing replacement variables, if you really want.

Though most of the time built in refactors like 'extract to _' or 'move to' or 'inline' or 'change type signature' or 'find duplicates' are enough.