Does intellij give notice of refactoring?

Does intelliJ provide for listeners who can be notified after a refactoring has happened?

Message was edited by:

1 comment
Comment actions Permalink

I haven't created any refactoring listeners, but here's what I found in the documentation.

Some refactoring listeners can be found in the com.intellij.refactoring.listeners package. The key classes and interfaces to look at are:


You want to implement RefactoringListenerProvider and RefactoringElementListener.

To register your listeners, add your provider via
RefactoringListenerManager.getInstance(Project project).addRefactoringListener(RefactoringElementListenerProvider provider)

Your listener provider should return your implementation(s) of RefactoringElementListener via getListener(PsiElement element)

There's also a MoveMemberListener interface in the package if you're interested.

Hope this is helpful to you.


Please sign in to leave a comment.