← Back to context

Comment by dist-epoch

2 days ago

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.

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.

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.

You’re missing the point, it’s about those tools drastically improving context window management. When you want to tackle large refactors, Claude Code will blow tens of thousands of tokens just searching for files and various refactor related file manipulation. When you run out of window in the middle of a big refactor you’re going to have a bad time.