Refactor is completely finished? Follow
I'm trying to figure out when and where the refactoring is completed in the source code. This is because I want to do an automatic Git commit when its done.
For example, if I have a Main class that is extended by childOne and childTwo and I rename the Main class to MainNewName, I want to add all files that are changed by it: Main, childOne, childTwo.
I know that the BaseRefactoringProcessor.java has a command to syncPublishers...refactoringDone. But this event is triggered too early. If I add a git commit at this stage it will add the main file but will miss that childOne and childTwo has been modified.
I have been trying to find out what class that is responsible for changing all occurrences of the altered file and to trigger and event from there but cannot find the correct class and method.
Does anyone know what function/process that are responsible for checking and renaming all variables/methods/classes that makes use of the renamed file?
Please sign in to leave a comment.
the `refactoringDone` doesn't include optimise imports + updates of non-code usages, though all references on the class should be actually updated. Doesn't help, I suppose. It's possible to postpone the event, but then you would probably need more info in it.
Rename is done by `com.intellij.refactoring.rename.RenameProcessor#performRefactoring` but I am not sure what you are looking for.