logoalt Hacker News

dist-epochyesterday at 7:42 PM2 repliesview on HN

People keep saying how amazing IntelliJ is at refactoring, but then you realize the talk about "rename thing" and "extract function".

This is 5% of what refactoring is, the rest is big scale re-architecting code where these tools are useless.

The agents can do this big scale architecturing if you describe exactly what you want.

IntelliJ has no moat here, because they can do well 5% of what refactoring is.


Replies

spullarayesterday at 8:30 PM

I think that the commonly used refactoring functions would make a big difference and right now most IDEs are pretty bad at them (especially across all the languages jetbrains supports):

  - rename variable/function
  - extract variable/function
  - find duplicate code
  - add/remove/extract function parameter
  - inline a function
  - moving code between classes
  - auto imports
Others are used more rarely and can probably be left out but I do think it would save a lot of tokens, errors and time.
Tareanyesterday at 11:54 PM

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.