Reputation: 2745
I spend a lot of time going back and forth between SBT and IntelliJ, getting a file, line number, and error from SBT and navigating to it in IntelliJ. Is there a way to automate this at all? Even if it's only via IntelliJ's compiler, I'd love to be able to navigate to the next error project-wide.
Upvotes: 88
Views: 31263
Reputation: 9343
This is a whole project, error to error, one-click solution after a 2-second setup. For both setups, optionally disable generate warnings
for your compiler.
Windows/Linux Setup
MacOS Setup
Now click
the first error in the Project Errors
tab, fix it, then click
the next error. Works regardless of build tool and may work in older versions of intellij than 2022.1.
Edit: Credit @Manuel Romeiro - the answer in his comment worked for a while, but stopped when intellij got confused somehow. Will update my answer if I figure that out.
Thanks @meridsa for providing setup step 1 for Mac. Also to @K. Symbol for syntax for showing keys in an answer (very cool).
Upvotes: 2
Reputation: 8886
To go to next compilation error in the next file:
Command-0
(go to messages tab where compile errors are)Down
arrow until get to next errorEnter
Esc
to get to back to code where this error isUpvotes: 7
Reputation: 351
On Mac, you can enable Fn regular key functionality in System Preference.
Choose Apple Menu > System Preferences.
Click Keyboard & Mouse.
Click the Keyboard tab.
Select the option Use All F1, F2, Etc. Keys As Standard Function Keys.
Quit System Preferences.
Upvotes: -3
Reputation: 3520
The highly voted answer has not really answered the question. The provided solution of F2
only navigates through the errors in the current file. But picking up from the comments, the suggestion below is not the ultimate answer but is a little bit closer.
Problems
as shown in the image belowThis will list all files that have errors.
F2
to navigate through the errors.At least with this method, it has narrowed down the files with the errors and are just a click away.
Upvotes: 5
Reputation: 24087
For the mac I couldn't find anything that worked until I discovered the following
cmd + 1 -> f2 (on files) -> escape -> f2 (inside file) -> cmd + 1 -> repeat
Upvotes: 2
Reputation: 96
For going to the next error across the entire project, use Alt+F2 instead of just F2.
Upvotes: 1
Reputation: 3692
For this specific question, just use F2 (Next) and Shift+F2 (Previous);
But for any other questions related to shortcuts of IDEA, searching in the Settings-Keymap is better than in Google.
Upvotes: 11
Reputation: 773
To navigate between errors or warnings in IntelliJ you can do one of the following:
Navigate
| Next / Previous Highlighted Error
.Upvotes: 86