Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.

Once I change the signature, my "Problems" view shows, say, a dozen errors.

What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?

(It's been a while, but I think the Visual Studio equivalent is F8.)

Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.

("Marker" is the general Eclipse term for errors, warnings, etc.)

like image 726
Woody Zenfell III Avatar asked Feb 24 '10 20:02

Woody Zenfell III


People also ask

How do I enable keyboard shortcuts in Eclipse?

the main preference page can be found under window > preferences > general > keys (or faster: press ctrl+3 , type keys and press enter ). from here you can see all commands and assign/change their associated keyboard shortcuts.

What is the keystroke for code completion in Eclipse?

println statement in your Java file, you can use the following Eclipse shortcut keys. Just type "sysout" in your Java editor and press Ctrl + space, which triggers code completion.


2 Answers

The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then to pick the topmost error, then Enter to go to it (which returns focus to the editor).

like image 162
Woody Zenfell III Avatar answered Sep 17 '22 13:09

Woody Zenfell III


Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.

  1. Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.

  2. Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.

  3. In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M

  4. Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .

  5. For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:

    • Ctrl + Shift + M
    • Down arrow
    • Enter

  6. Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.

  7. Save that, create some compile errors, and test it.

like image 33
kash Avatar answered Sep 20 '22 13:09

kash