Results 1 to 10 of 10
  1. #1
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default Netbeans 6.0 - code completion of method parameters

    I just updated to NetBeans 6.0 and I find the code completion of method parameters very annoying and counter productive.

    It inserts the parameters as keywords when choosing a method from the list after pressing CTRL+SPACE.

    How can I switch this off?

    I searched the options and also the forum but didn't find a solution.

    Sample - to understand what I mean:
    Java Code:
    public static String formatDate(Date myDate, String myFormat)
    When typing
    Java Code:
    Str.form<CTRL+SPACE,choose method, ENTER>
    it looks like
    Java Code:
    Str.formatDate(myDate, errorMessage)
    I know that myDate is selected by default afterwards and pressing space or whatever replaces the selected parameter. For a method with a single parameter is not a big problem but if a method has more parameters it is annoying, because although myDate is selected and I can overwrite it, I have to proceed to the next parameter with CTRL+M instead of simply typing a comma. This is very annoying if a method has more parameters and as this annoyance occurs approx. every 5 lines that accumulates.

    So I am searching for the appropriate option to switch that "feature" completely off. As this "feature" wasn't there in 5.5.1 I hope for the ability to switch off that.
    Greetings, Martin Wildam.

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    I am using a development build, so my options might be different. But what about unchecking "Insert Single Proposals Automatically" in Editor tab of the options window reached by Tools->Options?

  3. #3
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    No, does not work - tried that already.

    How does it behave at your site? - Does it insert the parameters automatically?

    I wonder if this is maybe errorous behaviour - maybe because I imported the settings from NetBeans 5.5.1.
    Greetings, Martin Wildam.

  4. #4
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    I just found out (also re-reading some NetBeans documentation) that the "errorMessage" in my test case was an attempt of NetBeans to guess the correct parameter to pass. "errorMessage" was a variable I used above but this was actually a bad guess.

    Too much guessing is not good. If I move the cursor to somewhere else before finishing a code line might be left with some bad "default" from the guess of NetBeans and as the line has been autocompleted I might forget easily that this line should have been completed.
    Greetings, Martin Wildam.

  5. #5
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    I had found autocomplete feature annoying before sometimes too. After your message i checked the options and as far as i see, unchecking that checkbox is working for me. I tried to call an existing method by writing the name of it and press Ctrl + Space, it just did not fill it automatically and shoed the options instead. But i might be wrong because i did not observe the behavior of this autocomplete closely/carefully.

  6. #6
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    No, it does not work - even if I restart the IDE. Maybe you have some other option set or you didn't understand me well, what I mean.

    It does also autocomplete the closing bracket. I am searching where to disable this but didn't succeed so far.
    Greetings, Martin Wildam.

  7. #7
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    The "Insert closing brackets" option does only work as expected if not using the code completion with CTRL+SPACE.
    Greetings, Martin Wildam.

  8. #8
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    I learned in the meantime that ENTER and TAB also jumps to the next parameter which is much easier than using CTRL+M (as mentioned in the NetBeans documentation). TAB is even better to use because when you navigate to another portion of the code for example to find the correct variable to use in the parameter TAB brings you back to the editing line and next parameter (as long as you didn't edit code somewhere else in the meantime).
    And SHIFT-TAB works also to bring you back to the previous parameter.
    Greetings, Martin Wildam.

  9. #9
    Cruxic is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Unhappy Make it stop!

    Like mwildam I also dislike the parameter guessing feature of Netbeans 6. I have yet to see it guess correctly - which means it creates more work because I have to first erase it's guesses. "Insert Single Proposals Automatically" does not control this feature as far as I can tell. Please let us know if anybody figures out how to turn this off. (cruxic ignoreatignore gmail.com)

  10. #10
    mwildam's Avatar
    mwildam is offline Member
    Join Date
    Aug 2007
    Posts
    72
    Rep Power
    0

    Default

    I worked now a few days with that feature and nevertheless even through the jumping with TAB feature I do not like that feature.

    I begin to think that either all automatic quote and braces generation does reduce productivity rather than improving it. It often ends up in more code needs to be deleted than written.

    For example when copy and pasting code portions usually there remain more braces than necessary.
    Greetings, Martin Wildam.

Similar Threads

  1. auto completion window does not pop-up
    By erdaffi in forum NetBeans
    Replies: 0
    Last Post: 12-11-2007, 01:48 PM
  2. Replies: 0
    Last Post: 11-10-2007, 05:47 PM
  3. get parameters in jsp
    By cecily in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-05-2007, 05:29 AM
  4. Replies: 1
    Last Post: 04-26-2007, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •