NetBeans Java Completion Is Too Impatient

Is it normal that the default behavior for code completion when editing Java is as follows?

  • If I import package, after entering the first . , any key pressed displays the first item in the selected list
  • Sometimes when typing keywords such as public and protected , NetBeans will make some jumps and insert private after entering only p or pu !
  • In general, he tends to make some big guesses in terms of autocomplete, guesses that are not supported at all by my previous entry.

I feel that this may not be the desired behavior for each user. Is there a way to make code completion not autocomplete something, or at least make it less interesting?

Edit: To be clear, I don’t want to disable the sometimes useful β€œAuto-Cover Window”. I want the window to appear impatiently with tips and suggestions about methods, syntax, whatnot - I just don't want NetBeans to try to guess what I want, because it is wrong 90 - 100% of the time.

+4
source share
3 answers

Which version of Netbeans you are using because it is not like the behavior I see in 7.1.

Autofill popups do not appear until I press Ctrl + Space. If I type "p" and then press Ctrl + Space, the popup will display "private", "protected" and "public". I can either type in the text (and the list becomes smaller as the matches are deleted), or use the cursors to select the word I want and press Enter.

If there is only one logical parameter, for example. I start typing β€œpu” and then press Ctrl + Space, then Netbeans automatically adds β€œpublic” (although this can be turned off).

Code templates are a completely different story, so I activated them using Shift + Space. As far as I know, there are no pop-ups in the templates. Anyone who likes pain can consider changing the activation key to a simple space: P

+1
source

I definitely share your complaints, especially re: 1. A quick Google search shows ways to turn off autocomplete :

Autocomplete is losing my mind. Ive always hated it - I feel like it slows down my computer, and sometimes it even seems like the middle of typing something fails me because the window appears and somehow focus. I will disable it in the "Options", "Editor", "General" (uncheck Auto Popup Completion Window).

0
source

Point 2) is more like a "code template" function, rather than autocomplete.

If this bothers you, you have two options:

  • change the key that "launches" the code template extension (for example, from "Space" to "Tab"
  • delete all push-pull patterns (or any other abbreviation that you would not want)

Both can be done under "Tools β†’ Options β†’ Editor β†’ Code Templates"

0
source

Source: https://habr.com/ru/post/1402918/


All Articles