RefactorInsight is a plugin for IntelliJ IDEA that enhances IDE representation of code changes with refactoring information in Java and Kotlin projects. RefactorInsight relies on RefactoringMiner and kotlinRMiner for retrieval of refactorings.
RefactorInsight is сompatible with IntelliJ IDEA 2021.1 and is available for free in the Marketplace: RefactorInsight.
To make reviewing bug fixes or new features easier, the plugin auto folds refactorings in code diffs and shows hints with their short descriptions.
Currently, it works for the following refactoring types: Move Method
, Pull Up/Push Down Method
, Extract Method
, and Inline Method
.
To see the refactorings in a git repository, open the built-in Git
tab. On the right side, you will see a toggle button .
Click on a commit and then on the to see the refactorings detected in that commit. It looks like this:
To see the refactorings in a specific pull request, open the Pull Requests
tab, select any pull request and click on the .
In order to see the refactoring history of a method, class, or attribute, right-click on the object's signature and select Check Refactoring History
. Here is an example for a method named Repl
:
If you double-click on a leaf node in a tree, the VCS log opens at that specific commit and shows a list of detected refactorings in that commit.
By default, for performance reasons, refactorings are only retrieved from the last 100 commits in history. This number can be adjusted in the plugin's settings. Alternatively, you can use Mine All Refactorings
action in the Tools
menu to go through all commits in the history of your project.
The plugin also keeps track of new commits and processes them.
The detected code refactorings are stored in .idea/refactorings.xml
. If this file is deleted, RefactorInsight will mine refactorings again once you make a commit.
To submit a bug report or suggest a feature, please open an issue. Pull requests are welcome and encouraged.
This paper provides a detailed overview of RefactoringMiner — the tool RefactorInsight relies on to identify refactorings.