Possible to view method / function docs in NetBeans? - netbeans

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?

Related

IntelliJ Cursive s-form documentation on hover over

Is it possible to have IntelliJ/Cursive display a pop-up with s-form's definition and documentation when that s-form is hovered over with a mouse, like it's done in Eclipse? Ctrl+Q seems to bring up the window, but I'd like for it to open up automatically without me hitting a shortcut. Is this a configurable setting or something? Also, what is a similar key combination to bring up a source pop-up?
Thank you in advance.
No, there's no way to do this automatically on hover. You can see the source pop-up using View->Quick Definition - the keybinding will depend on the keymap and platform you're using. The keybinding should be shown in the menu, otherwise you can search for "Quick Definition" in Settings->Keymap.

How to enable "live search" in eclipse?

In Komodo Edit, an input field is available in the toolbar. When I type text in it, it highlights matching search results. Is there something like this in Eclipse, either directly or via a plugin?
As TK Gospodinov has already mentioned, there is an Incremental option in Find/Replace (Ctrl+F) dialog.
There is also a special key binding for Incremental search in Eclipse (and personally I use it more frequently). From Eclipse Tips and Tricks:
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.
If you'd like to have search functionality in a toolbar, you may be interested in the eclipse-glance plugin, which allows you to use the incremental search function in a toolbar by pressing Ctrl + Alt + F while in any text area.
This feature is already available in eclipse. No need to install any plug-in.
Press Ctrl+F, and the Find pop up appears.
Now check the incremental checkbox, and then your texts will be found as you type. No need to hit return.
OR
Use Ctrl+J and you can activate the live search, just that there wont be any UI visible, but you can see the status in eclipse status bar at the bottom.
Press Ctrl+J, start typing the text you want to search for. Press esc to go back to edit mode
The closest thing to the functionality you are asking about is the 'incremental search' mode, which is triggered by checking the 'Incremental' checkbox in the Options group on the Find/Replace dialog in Eclipse (Ctrl+F from the code editor). This will make it start highlighting matches as you type, and if they are keywords, Eclipse will highlight other occurrences (references) in the code editor. Matches inside strings or Javadoc will not be highlighted, however, unless it happens to be the first match after your cursor's position inside the editor.
One similar thing (not the same) is just enabling "mark occurences", then selecting function name, variable etc.

Jump into interface implementation in Eclipse IDE

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.

Faster way (keyboard shortcuts?) to use quick fixes in Eclipse?

I often use the Eclipse feature (Galileo) of suggested error corrections to automatically create code stubs or to refactor things. For example, I would write a method that calls other methods which don't exist yet, then move the mouse over the error message and click on "create method". Or, change this to the class name and choose "add static modifier" from the quick fixes.
I think this is very convenient because it lets me stay in one place in my code and sort of "remotely" wire up what's not currently visible on my screen. What I think is annoying though, is that I have to leave the keyboard, hover my mouse over the error symbol, wait for the tooltip to pop up, and click on the option (doing that, I sometimes move the mouse a little over the edge and the tooltip goes away again - very annoying).
Am I missing a faster method here? I can't seem to find a keyboard shortcut, but then I have overlooked stuff from the huge preference dialog before.
Ctrl+1 : Quick Fix.
(Cmd+1 on Mac)
Just put your cursor on the part you suspect you can perform an action (correction, refactoring, ...) and hit the Quick Fix shortcut. The same popup will be displayed, and you can select the right option with the up and down keys.
That, combined with Ctrl+3 (Quick Access) gives you most of eclipse features at your fingertips ;)
See also:
Eclipse Tip: Shortcut to Quick Fix
My Favorite Eclipse Shortcut: Quick Fix
Eclipse hotkeys: eclipse shortcuts gold mine.
As an additional tip, a specific type of quick fix I use all the time has a dedicated shortcut:
Alt+Shift+J: Add Javadoc comment stub for current method.
After using ctrl+1 like mentioned in the top answer, press ctrl + enter to apply the selected fix all to problems of the same category.
In general, keyboard shortcuts in IDEs (and code tools in general) are coming from a user principle that holds that the more your hands/fingers can remain poised over the keyboard (as in the f-j centered "touch typist" position), the more productive you can become. This is probably why the use of the number keypad is not encouraged, or other keys, less common to the most basic layout keyboard, are not used. Many hold that useful keyboard shortcuts should be easily reachable from this position.
One thing I will say about eclipse keyboard shortcuts is that if you use a popular Windows presentation utility called Zoom-it, you need to turn that off when using eclipse. There are several show-stopper conflicts between the two, such as Ctrl-1 and Ctrl-3.

short for custom surround with

Is there any shortcut for surrounding any selection with a template from "Surround With..."?
In this special case, I defined a surround with brackets template... It would be a great enhancement to have such a shortcut.
Thanks for your help in advance.
The only shortcut I know about for surround templates
(that is for templates with ${line_selection} variable in their definition)
has been introduced in eclipse 3.2 (refined actually in eclipse3.2 M4)
It is the "Surround With Quick Fix" mechanism
(source: kano.net)
Assign a shortcut to Quick-Fix (CTRL-1 by default), and if your selection is eligible ((contains a line), all compliant templates will be displayed in the Quick-Fix dialog.
You will then be able to choose the appropriate surround template (like the one you defined).
Answer from #VonC is not working on Eclipse Kepler. Use short cut for show surround with quick menu.
Select one or more lines in java editor press Alt + Shift + Z then you will get the popup context menu as shown below(Menu items differ based on the region of selection).