Return to site

INTELLIJ SHORCUTS: Alt + Enter ๐Ÿ‘‰ Show intention actions and quick-fixes

ยท coding,intellij
broken image

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.