Skip to content

maio/quick-fix

 
 

Repository files navigation

This is a plugin for IntelliJ IDEs which:

  • Adds Quick Fix action to apply the first available quick fix (equivalent to pressing alt+enter, enter). Quick Fix is assigned to F1 so you might need to unassign F1 from the Context Help action.
  • Registers all available intentions as actions so you can assign shortcuts to them (see this youtrack issue). For example, if you have Java or Kotlin plugin enabled, you can use Find Action to search for "put arguments". The search results should include "Put arguments on one line (Intention)" line on which you can alt+enter and specify your own shortcut for this intention.

What's wrong with Alt+Enter?

Pressing alt+enter, enter is too many key presses when you already know that the top inspection is going to do what you want. To avoid this you can use Quick Fix action to apply the first available inspection.

Some intentions are used so frequently that pressing alt+enter and choosing the right row in the popup list becomes tedious. It also doesn't help that depending on the context, the intention you're looking for might not be on the same row as it was before. To solve this problem the plugin creates actions for all intentions so you can assign keyboard shortcuts and invoke intentions without any popup windows. Note that all actions generated by the plugin have "(Intention)" postfix so you can distinguish them from other actions.

Finally, alt+enter is physically not the easiest shortcut, especially if you use it a lot... As an experiment Quick Fix action is assigned to F1 because it's a single key and located near F2 - Next Highlighted Error. You might need though to unassign F1 from the Context Help action which is mostly useless anyway.