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 270543 - CTRL+space bar (code completion over an existing instruction or method name) replaces the current word wrongly
Summary: CTRL+space bar (code completion over an existing instruction or method name) ...
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: Dev
Hardware: PC Windows XP x64
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-03 08:06 UTC by Pere
Modified: 2017-05-03 08:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pere 2017-05-03 08:06:10 UTC
Lets say you have a .getData() method in a piece of code in your java open file. Put your cursor over it. Put it after the "e" letter. Press CTRL+space. Let's say you have code completion/suggestions and related classes properly set up. Let's say it offers a handful of suggestions starting with "ge", with the following ones between them:

getClass()
getCaption()
getId()
(...)

Select whichever one you like. For instance, getCaption(), and press enter. 
.getCaption() should have replaced .getData() in your file, but, instead, you now have .getCaption()tData, or .getCaption()etData() or some other kind of mess depending on where you placed your cursor.

If I'm not wrong, those things work by selecting and replacing the entire existing function/method name by the new one you selected, and that used to do Netbeans until the recent dev versions.
Comment 1 Dusan Balek 2017-05-03 08:22:11 UTC
By default, code completion simply inserts the selected completion item to the text at the caret position. To replace existing identifier at the caret position, press 'Ctrl+Enter' when selecting completion item from the list.