Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 829
Markus Weninger Avatar asked Jan 27 '23 14:01

Markus Weninger


2 Answers

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.

like image 184
yole Avatar answered Jan 30 '23 04:01

yole


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).

like image 41
Roland Avatar answered Jan 30 '23 03:01

Roland