Go to next compiler error across project in IntelliJ

ScalaIntellij Idea

Scala Problem Overview


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.

Scala Solutions


Solution 1 - Scala

To navigate between errors or warnings in IntelliJ you can do one of the following:

  • Use keyboard shortcuts F2 (Next) and Shift+F2 (Previous) respectively.
  • On the main menu, choose Navigate | Next / Previous Highlighted Error.

Solution 2 - Scala

I am using Ctrl+Alt+Up/Down to scroll through the list of errors. This is inside the Compile Messages window. The SBT Console uses the same shortcut, as stated in the SBT wiki.

Solution 3 - Scala

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.

Settings-Keymap

Solution 4 - Scala

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 error
  • Enter
  • Esc to get to back to code where this error is

Solution 5 - Scala

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.

  1. Select Problems as shown in the image below

enter image description here

This will list all files that have errors.

  1. Use 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.

Solution 6 - Scala

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

Solution 7 - Scala

2022 UPDATE

This is a whole project, error to error, one-click solution after a 2-second setup.

Windows/Linux Setup

  1. Alt6 or click Project Errors tab of Problems tool window
  2. CtrlNumPad+ or click expand all to expand all errors

MacOS Setup

  1. Cmd6 or click Project Errors tab of Problems tool window
  2. Cmd+ or click expand all to expand all errors

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

Solution 8 - Scala

For going to the next error across the entire project, use Alt+F2 instead of just F2.

Solution 9 - Scala

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionblahaView Question on Stackoverflow
Solution 1 - ScalaAlejandroDGView Answer on Stackoverflow
Solution 2 - Scalasina72View Answer on Stackoverflow
Solution 3 - ScalaK. SymbolView Answer on Stackoverflow
Solution 4 - ScalaTomer Ben DavidView Answer on Stackoverflow
Solution 5 - ScalaKihatsView Answer on Stackoverflow
Solution 6 - ScalaatreeonView Answer on Stackoverflow
Solution 7 - Scalacb4View Answer on Stackoverflow
Solution 8 - ScalaReuben SteenekampView Answer on Stackoverflow
Solution 9 - ScalaElliscope FangView Answer on Stackoverflow