Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make auto completion in netbeans include both variables as well as methods?

Tags:

I was curious if anyone knows a way (by using a setting or a plugin or something), that would allow me to select variable names on the fly in netbeans, in the same way that Visual Studio 2008 does using an automatic popup window? At the moment I can access them by pressing Ctrl + Space, but I wondered if there is a way that I could avoid this and just have them come up automatically as I type, and the methods would come up with the '.' operator as normal?

The settings in 'Tools->Options->Editor->Code Completion' doesn't seem to have the Ctrl + Space setting I'm looking for, only a tickbox for toggling the normal '.' code completion of method names on or off..

(if it helps, the version of Netbeans is 6.9.1, and I'm writing in Java for Glassfish)

like image 249
Steve Rathbone Avatar asked Dec 06 '10 03:12

Steve Rathbone


People also ask

How do I Auto format in NetBeans?

Select the lines you want to reformat (indenting), then hit Alt+Shift+F. Only the selected lines will be reformatted. Show activity on this post. Ctrl + Shift + F will do a format of all the code in the page.

How do you use auto completion?

Autocomplete, or word completion, is a feature in which an application predicts the rest of a word a user is typing. In Android and iOS smartphones, this is called predictive text. In graphical user interfaces, users can typically press the tab key to accept a suggestion or the down arrow key to accept one of several.

How do I enable suggestions in NetBeans?

It is easy to enable Java hints in NetBeans. Select "Tools" from the title bar, then select "Options" from the drop-down menu. Choose the "Editor" option and then select the "Hints" tab. At this point, make sure that the "Language" drop-down is set to "Java" (other choices include PHP, JavaScript, and Ruby).


1 Answers

I tried to get the desired feature by adding the alphabet to the completion selectors. It worked somewhat, you can always try it.

Goto:

Tools -> Options -> Editor -> Code Completion

Select

Language: [Java]

Check:

[X] Auto Popup on Typing Any Java Identifier Part 

Completion Selectors for Java:

[.,;:([+-=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ] 

Good Luck!

like image 183
ejohansson Avatar answered Sep 17 '22 21:09

ejohansson