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.
Related
I want to jump from an class (method) that implement an interface (method) to the interface method by a keyboard shortcut in Eclipse.
Is there a shortcut to do this?
Goto to "Window" -> "Preferences" -> "General" -> "Keys
There search for "Open Super Implementation" and create a key binding for that.
Press F4 with focus on the method.
answer to the question described in comments under flafoux answer, but to clearly explain the answer, giving here...
Select Method in implementation and Press F4 button
It shows Type Hierarchy
On Type Hierarchy, on the top section click on toolbar button Show Supertype hierarchy (this step is only required once)
On Type Hierarchy, detail section shows Interface method
Click on the (automatically selected) method
Use Quick Type Hierachy, Ctrl + T.
When this is used while the cursor is inside a method you will get a popup which lets you select among the superclasses which declare the current method. By pressing Ctrl + T again while the popup is still open it lets you select among implemented interfaces which declare the current method.
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:
In eclipse, when mouse pointer moves over on method help hint shows. I want to show method help on eclipse like Visual Studio. When I pressed Ctrl+Shift+Space when cursor inside method parenthesis, I want to see method help as hint. How can I do it? Which shortcut's setting should I change?
PS: Netbeans IDE completley works as I wanted, but I want to do same in eclipse.
You can use the JavaDoc View (View -> Show View -> JavaDoc / Alt+Shift+Q,J) to show the JavaDoc of the method your text cursor is inside. Or place the mouse cursor over the method name and the JavaDoc will be presented as tooltip.
F2 (Show Tooltip decription) will give you the JavaDoc as mentioned in your question update. Ctrl-Shift-Space gives you Context Information (e.g. list of all possible methods) and you probably won't lose this due to new declaration.
In General > Editors > Keys look the command should be "Show tooltip description", which is binded to F2 as default (same effect as the hover tooltip)
File -> Settings -> Editor -> General
In the other Section you will find - "Show quick doc on mouse move"
Just mark the checkbox to help in 500ms(Time delay is changable)
You know how in Eclipse, pressing F3 over a method will take you to its declaration? Well I have a method that is part of an interface; clicking F3 over this naturally takes me to the declaring interface.
Obviously there is an object implementing this interface and this is where the method is actually implemented. I want, when I press F3, to jump to the implementation, not the interface declaration. I know that the implementation may not be known at compile-time, so is there a way for Eclipse to show me all the classes implementing the interface so that I can select which implemented method to view? Right now when this happens I am just manually searching for this to find the implemented method.
Here's what I do:
In the interface, move the cursor to the method name. Press F4. => Type Hierarchy view appears
In the lower part of the view, the method should already be selected. In its toolbar, click "Lock view and show members in hierarchy" (should be the leftmost toolbar icon).
In the upper part of the view, you can browse through all implementations of the method.
The procedure isn't very quick, but it gives you a good overview.
Well... well... I hope you use Eclipse Helios, because what you asked is available on Helios.
Put your text cursor again on the method and click menu Navigate → Open Implementation. Now if you have more than one implementation of the method, you will get choice to pick which implementation to open.
By defining a keybinding on Preferences → General → Keys you can even use the feature easier, but before you do that, see if this shortcut is fast enough for you.
Press Ctrl + click and hold. Now move your mouse over the same method. Tadam… you will get choice.
If you pick Open Implementation you’ll get the same choice as before.
Press Ctrl + T on the method name (rather than F3). This gives the type hierarchy as a pop-up so is slightly faster than using F4 and the type hierarchy view.
Also, when done on a method, subtypes that don't implement/override the method will be greyed out, and when you double click on a class in the list it will take you straight to the method in that class.
There's a big productivity boost if you add an Alt + F3 key binding to the Open Implementation feature, and just use F3 to go to interfaces, and Alt + F3 to go to implementations.
Highlight an interface and use Ctrl+T to open "Quick Type Hierarchy".
ctrl + mouse hover + click "Open Implementation"
On ctrl + hover, you should see the following menu:
Tested on Eclipse Mars.2 (4.5.2)
Here is what I do:
I press command (on Mac, probably control on PC) and then hover over the method or class. When you do this a popup window will appear with the choices "Open Declaration", "Open Implementation", "Open Return Type". You can then click on what you want and Eclipse brings you right there. I believe this works for version 3.6 and up.
It is just as quick as IntelliJ I think.
See In eclipse, ctrl-click goes to the declaration of the method I clicked. For interfaces with one implementation, how can I just directly to that implementation? for some alternative solutions.
Anyway, I think you might be looking for something like this:
http://eclipse-tools.sourceforge.net/implementors/
I always use this implementors plugin to find all the implementation of an Interface
http://eclipse-tools.sourceforge.net/updates/
it's my favorite and the best
If you are really looking to speed your code navigation, you might want to take a look at nWire for Java. It is a code exploration plugin for Eclipse. You can instantly see all the related artifacts. So, in that case, you will focus on the method call and instantly see all possible implementations, declarations, invocations, etc.
The best solution would be Ctrl+Alt+I.
NetBeans 6.5 with Python support provides the docstring documentation for a function/method in a popup when auto-completing, but is there another way to view docstrings?
Perhaps achieved by mousing over a function/method name, or clicking somewhere?
The best I can seem to do is "Go to source" in the right-click menu.
I received the following answer from Tor Norbye at Sun:
Hold the ctrl key (or Cmd on Mac) and then hover.
Also, Ctrl-Shift-Space (e.g. code completion + shift) will display -just- the completion doc (which means it doesn't just look at the prefix of the caret, but the whole identifier and left hand side type if it can resolve it, to compute one specific match rather than many).
You can also use this keyboard shortcut on Mac. Shift + Meta + Backslash
You may be referring to the function Show Documentation Popup in Netbeans
Try
Ctrl+Shift+SPACE or
Ctrl+Shift+BACK_SLASH
related: How to see Javadoc documentation on mouse hover in NetBeans?