Return to site

INTELLIJ SHORCUTS: Alt + Enter 👉 Show intention actions and quick-fixes

March 18, 2022

As you work in the editor, IntelliJ IDEA analyzes your code, searches for ways to optimize it, and detects potential and actual problems.

As soon as the IDE finds a way to alter your code, it displays a yellow bulb ðŸŸĄ icon yellow bulb icon in the editor next to the current line.

By clicking this icon, you can view intention actions available in the current context.

Intention actions cover a wide range of situations from warnings to optimization suggestions.

A red bulb ðŸ”ī with an exclamation mark the Quick-fix icon indicates that IntelliJ IDEA has detected a problem, and prompts you to select an associated fix — a quick-fix.

Quick-fixes and intention actions together are called context actions.

 

ð—”ð—―ð—―ð—đ𝘆 ð—ķð—ŧ𝘁ð—ēð—ŧ𝘁ð—ķ𝗞ð—ŧ ð—Ū𝗰𝘁ð—ķ𝗞ð—ŧ𝘀

𝟭. Click the bulb icon or press 𝐀ðĨ𝐭+𝐄𝐧𝐭𝐞ðŦ to open the list of suggestions and select an action from the list.

ðŸŪ. Press 𝐂𝐭ðŦðĨ+𝐐 or 𝐎𝐞ðĨ𝐞𝐜𝐭 𝐕ðĒ𝐞𝐰 | 𝐐ðŪðĒ𝐜ðĪ 𝐃ðĻ𝐜ðŪðĶ𝐞𝐧𝐭𝐚𝐭ðĒðĻ𝐧 from the main menu to open an intention preview.

If an intention is complex, and the preview cannot be generated, you will see the intention description.

Hover the mouse pointer over available intentions on the suggestion list to preview them.

Once activated, the preview will appear every time you open the list of available intention actions.

To close the preview, press 𝐂𝐭ðŦðĨ+𝐐 again while the list of intentions is open.

ðŸŊ. Press Enter or click an intention on the list to apply it.