Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans IDE autocomplete 'contains'

Tags:

java

netbeans

Does anybody know if there is a way to get NetBeans code autocomplete to filter by 'contains' rather than 'starts with'.

E.g. MyClass has getBlaBla(), setBlaBla() and someOtherBlaBla()

I want to be able to say MyClass.BlaBla and for the code completion to suggest all three of the method names above. Would be really useful for when you dont quite remember what the method name was but know it contains that word.

like image 421
Blueberry Avatar asked Jun 26 '12 16:06

Blueberry


People also ask

How do I show auto suggestions in NetBeans?

To get auto popup code completion we go to Tools | Options | Editor | Code Completion. We select Java from the Language combo box. The option dialog window shows the option Auto Popup on Typing Any Java Identifier Part (What is in a name?). We must select the checkbox to get auto popup code completion.

How do I turn off suggestions in NetBeans?

If you go into NetBeans > Tools > Options > Editor > Code Completion, you can check or uncheck "Auto Popup Completion Window" for whatever Languages you want.


1 Answers

For future reference, this is implemented since NetBeans 7.4 and can be enabled in the options:

  1. In the menu bar click Tools -> Options
  2. In the Options window open the Editor section and then click on the Code Completion tab
  3. Tick the checkbox Subword completion

For Netbeans 8.0.2:

  1. Under Preferences-> Editor tab -> Code completion tab
  2. Change the Language drop down menu option from All Languages to Java
  3. Tick the checkbox Subword completion

This is a really handy option :)

like image 117
bertuslakkis Avatar answered Oct 21 '22 17:10

bertuslakkis