This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 139870 - [65cat] Code completion overwrite
Summary: [65cat] Code completion overwrite
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 6.x
Hardware: Other Linux
: P3 blocker with 3 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 139953 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-14 13:03 UTC by marcelheijmans
Modified: 2008-10-15 13:18 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marcelheijmans 2008-07-14 13:03:30 UTC
[ BUILD # : 200807040101 ]
[ JDK VERSION : 1.6.0_04 ]

Consider the following code:

plane.findMakeAndModelByName(name);

If there is another method findMakeAndModelByCode() and the cursor 
is just after By than pressing CTRL+Space will pop up code 
completion. If the other method is selected the result is:

plane.findMakeAndModelByCode(code)Name(name);

Is it possible to make auto complete a bit smarter and delete the 
Name(name), i.e. overwrite the old code.

IntelliJ does this, and it is much appriciated.
Comment 1 nvarun 2008-07-15 07:18:20 UTC
I don't know about Intelli J, but its even present in Visual Studio, though that's not an open-source proj, still we
need to be at par with all features, as possible.

Though, this can't be a show-stopper, still its a feature that's required to be enhanced.
Comment 2 Vitezslav Stejskal 2008-07-15 08:17:02 UTC
This would definitely be useful. I think Max had been doing some improvements in this area.
Comment 3 Vitezslav Stejskal 2008-07-15 10:45:04 UTC
*** Issue 139953 has been marked as a duplicate of this issue. ***
Comment 4 nvarun 2008-07-15 10:50:21 UTC
*** Issue 139953 has been marked as a duplicate of this issue. ***
Comment 5 karmagfa 2008-07-19 16:45:20 UTC
I personally think that the end of the method should be replaced, but not the parameter.

If there is already a parameter there, maybe it means that the user wrote it. It is impolite to overright what the user
writes. I know that there is still the undo action, but if the undo also remove the new method name, the user will be
upset against the IDE.
Comment 6 Petr Dvorak 2008-07-19 17:11:21 UTC
karmagfa: Well, I rather tend to agree (I think VisualStudio does it so too and it is quite OK), but I think it needs a
lot of discussion (maybe a setting for that?) Suppose you want to replace method "myMethod1(Point p)" with
"myMethod2(int X, int Y)" - should the parameter be kept? Like this "x.myMethod2(iPoint)"? Hard to say...

I think it could be like that: method parameters are preserved if they match the new method's parameter only...
Comment 7 Dusan Balek 2008-10-15 13:18:25 UTC
Already Implemented. Use Ctrl+Enter to select item from the code completion list.