Reputation: 13
I am using Netbeans 11.2. Basically I want to use a method called getNext()
and when I type for example variable.g
and wait for the autocomplete, then the first option is getClass()
. I just press the down arrow key to select getNext()
and I press tab, but the autocomplete only writes get
(meaning now I have variable.get
) and it selects again the first option getClas()
, and I have to press down arrow key again to select getNext()
to write the full sentence.
Is there a way to make autocomplete write getNext()
in just one tab press?
Upvotes: 1
Views: 245
Reputation: 17363
There is no direct way to resolve this, because autocompletion is working correctly. There are quite a few possibilities with .g
, .get
, etc., and NetBeans has no way of knowing which option you want, so it has to show them all, and let you pick.
However, there is a simple workaround: you can easily create a new code template. Then, if you enter an abbreviation of your choosing, and press [tab], that abbreviation will be replaced with the text getNext();
as follows:
getNext();
.To do that:
getNext();
.This screen shot shows the abbreviation yy
mapped to the expanded text getNext();
:
Then, in your edit window just type yy and press tab to generate getNext();
.
Notes:
yy[tab][esc]
to generate getNext();
Upvotes: 1