Skip to content

An IntelliJ IDEA plugin that enhances IDE representation of code changes with refactoring information

License

Notifications You must be signed in to change notification settings

ElenaErratic/RefactorInsight

 
 

Repository files navigation

RefactorInsight Icon RefactorInsight

JB Research pipeline status Downloads

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.

Getting started

RefactorInsight is сompatible with IntelliJ IDEA 2021.1 and is available for free in the Marketplace: RefactorInsight.

Smart diff

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.

Example

Refactorings in commits

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:

Example

Refactorings in Pull Requests

To see the refactorings in a specific pull request, open the Pull Requests tab, select any pull request and click on the .

PullRequests

Refactoring history of an object

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:

RefactoringHistory

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.

Settings

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.

Contribution and feedback

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.

About

An IntelliJ IDEA plugin that enhances IDE representation of code changes with refactoring information

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 91.5%
  • Shell 7.0%
  • Perl 1.5%