Markus Weninger
Markus Weninger

Reputation: 12648

IntelliJ: (Keyboard shortcut to) jump to next / previous suggestion

I know how to jump to the next and previous error (F2, see SO Link, jetbrains.com), but is there a way to easily jump between suggestions?

If possible, I would really love to have a keyboard shortcut for this, as I am currently learning Kotlin and IntelliJ often has nice suggestions on how to improve the code. If there is no keyboard shortcut to jump between suggestions, is there at least any other way?

With suggestion I mean things like the following (Ignore the "nonsense code")):

Example suggestion in IntelliJ

Upvotes: 4

Views: 768

Answers (2)

Roland
Roland

Reputation: 23232

Adding to yole's answer: if you want to jump backwards you can use Shift + F2 instead.

Additionally you can alter the severity of each inspection (or inspection group) using the settings menu File | Settings | Editor | Inspections or directly using the intention action context menu (ALT + ENTER or similar) when dealing with a highlighted element (be it warning, error, information, etc.).

Note that some inspections are not enabled by default and many allow customization to your needs (e.g. class naming conventions, etc.).

I did once increase the severity of all the inspections and switch them back one by one as needed or even turned many off (or switched them to "weak warnings"), just to easily jump back and forth between them. I can't recommend that approach anymore ;-) (too many highlightings then... but it may help to find out about inspections you consider more helpful).

Upvotes: 2

yole
yole

Reputation: 97133

F2 also works to navigate between warnings. If there are errors in the file, it will jump to the next error. If not, it will jump to the next warning.

Upvotes: 6

Related Questions