Programmatically invoke refactor?

Answered

Is it possible to refactor (rename method/class/variable etc.) outside the IDE? My use-case is

  • I have thousands of repos
  • These repos have places which invoke functions from external libraries (external meaning the library classes/functions don't live inside the repo, but I own them)
  • I would like to rename the methods in these external libraries and then programmatically refactor my thousands of repos that use these libraries

Is it possible to do this from outside the IDE or create a CLI that uses the same API that intellij uses? I know there are tools that can parse the Java AST and I could manipulate it using AST parsers this way, but it'd be great if I could avoid re-writing whatever Intellij always does.

0
1 comment

Refactoring is possible only inside the launched IntelliJ IDEA. 

There could be a way with Fleet backend, but it is yet to be released. 

0

Please sign in to leave a comment.