Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply "quick fix" to multiple errors at once in IntelliJ?

In IntelliJ, pressing Alt+Enter on an error pops up a dialog that shows a fix which gets applied when you press Enter. Is there a way to do that action on multiple errors of the same type in the a file?

like image 640
Glide Avatar asked Dec 03 '15 06:12

Glide


People also ask

How do I use quick-fix in IntelliJ?

Press Alt+Enter or click the action indicator to the left of the caret to open the action list. Click the desired quick-fix or select it using arrow keys and then press Enter .

How do I fix errors in IntelliJ?

Apply fixes in the Problems tool window icon on the toolbar or in the context menu. You can also press Alt+Enter and select a suitable fix from the popup menu.

How do I select all the same words in IntelliJ?

You can use ⌃⌘G (macOS), or Ctrl+Alt+Shift+J to select all matching words in the document rather than selecting one at a time. You can use ⌃⇧G (macOS), or Alt+Shift+J (Windows/Linux) to remove the selection from the last selected occurrence.


2 Answers

First press Alt+Enter, then , select Fix all 'xxx' problems in File, Enter. Here's what it should look like:

Clarifying screen shot

like image 168
Bas Leijdekkers Avatar answered Oct 21 '22 08:10

Bas Leijdekkers


On Mac, + (Option + Enter)

like image 32
mani_jena Avatar answered Oct 21 '22 07:10

mani_jena