Eclipse: show error message only with keyboard - eclipse

I love my keyboard. When coding(c++) in eclipse some time I do some syntactic mistakes. For example
std::String
it should have been std::string. I have been coding some java programs :p. What I m looking for is a way to display the error info
Type 'std::String' could not be resolved
using some keyboard shortcut. Instead of clicking on the bug icon that appears on the left side of the page. I know about CNTRL + '+' and '.' . So how do I do this ? Thanks

In the source code editor, pressing F2 while the (keyboard's) cursor is at at underlined text opens an overly window that contains the warning/error description. Works for JDT/java, so I assume it's the same for CDT/c++.
In addtion, (in JDT/java) pressing F2 on methods/classes without problem shows the javadoc in an overlay window.

I don't know about a keyboard shortcut for that, but here is another solution:
Open up the "Problems" view (Window -> Show View -> Problems) and position it wherever you like.
You can configure what problems are shown there by clicking on the small triangle in the upper right corner. There you have to select "Show -> Errors/Warnings on Selection". This way only errors in the currently edited file will be visible.
Now you have all your syntax errors in view without any keyboard interaction at all.
Screenshot:

Related

How to close Type Hierarchy popup in Eclipse CDT

If I press F4 on a symbol, the type hierarchy will pop up in the top right corner. When I am done using it, I have to manually click the X to close it. Is there a way to close it using a keyboard shortcut?
I didn't know this before, but your question prompted me to dig a bit, and I found that "F12" is a shortcut for "Activate Editor", which hides the Type Hierarchy view and gives focus back to the editor in your scenario.

Eclipse shortcut for getting the error context menu

Well the title may be little confusing, but I believe everyone is familiar with the feature that Eclipse usually lets you autocorrect the possible mistakes just by clicking a light bulb
icon present at the left margin of the code editor. When we press that light bulb, we get some autocorrect options in a context menu. Is there any available shortcut for that?
I think you mean Ctrl+1 (Press the Control-Key then without releasing it, press the One-Key)
That should pop up that menu, if the cursor is on the error (in your case between the C and the l from CustomerImpl).

Netbeans keyboard shortcut for navigating to next error marker in editor

Is there any keyboard shortcut key for navigating to the next error (red markers created in error stripe) in Netbeans editor?
As of NetBeans 8 there doesn't appear to be a way to navigate through errors exclusively in the editor. If you look at tools->options->keymap an action does exist for this (next error in editor), but the shortcut is blank. I set it to Alt+E on my IDE, this will navigate through all annotations - not just errors. So if you don't mind cycling through all hints, warnings errors, etc, this will work.
The closest I've been able to get for navigating specifically through errors is using the action items window. Add a filter for errors, then you can use Ctrl+. and Ctrl+, to navigate through the list (see How to display all compile errors in Netbeans as a task list?).
That would be Ctrl-Period ::: (Period means .)
Links to many shortcuts:
Highlights of NetBeans IDE 8.0 Keyboard Shortcuts & Code
Templates
134 Shortcuts for NetBeans 8 (Windows)
EDITED--URLs NOW VALID thru ver. 8
Add the Action Items window to your IDE. This lists all of your errors and is dynamic, so will be updated when you save.
From the menu bar: Window->Action Items.
(Took me forever to understand why when I would save, I wouldn't see any compile errors, but then it wouldn't run.)
Actually question is about "next error in editor". At least in my configuration (NetBeans profile) this function doesn't have any shortcut by default so if you go to Tools->Options->Keymap and in search field you write "Next Error in Editor" you can add any shortcut that fits the best to you
On a Mac things are different and there is no keyboard shortcut for navigating to a usage/compile error as far as I can tell.
You can go to Help -> Keyboard Shortcuts Card to see the full list of short cuts for your platform.
See https://netbeans.org/kb/articles/mac.html for info for macs and https://usersguide.netbeans.org/shortcuts.pdf for the default shortcuts for PCs.
No. there is no good and easy way on keyboard.
just clicking on those red marks (by mouse) is the fastest way. (it's not an easy/good way. but the best possible.)

How do I "Show Documentation" in Eclipse?

I'm looking for the equivalent to CTRL-Q of IntelliJ, that shows you the documentation for the current code.
I've never used IntelliJ, so not sure it's an exact equivalent, but when I press F2 in Eclipse, I have a popup that displays some help.
For example, here, I pressed F2 as my pointer was on Log :
(source: pascal-martin.fr)
To see the attached Javadoc of a class, you can open the Javadoc view in another panel by pressing Alt + Shift + Q, J (as described in this answer). Alternatively, select "Window -> Show View -> Other -> Java -> Javadoc". The view will be updated with the selection in the code editor and will show the Javadoc for the method, class or even field at the cursor position.
I don't know if there is anything similar for other languages though.

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.)
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).
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.
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.
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.
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
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 + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
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.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).