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 253206 - Autocomplete should perform a read-ahead so as to not insert duplicated text
Summary: Autocomplete should perform a read-ahead so as to not insert duplicated text
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-26 09:23 UTC by Leperous
Modified: 2016-11-21 15:28 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 Leperous 2015-06-26 09:23:10 UTC
When performing autocompletion, when I select a suggestion then the editor should merge the input value with what is currently there.

Suppose I have the following classes:

 class Bar { ... }

 class FooBar { ... }

And some code:

 Bar bar = new Bar();

Suppose I wish to change the type of Foo to FooBar. I place the caret at the start of the line and hit CTRL+SPACE, and type "Fo":

 |Bar bar = new Bar();
 ^ suggested "FooBar"

If I hit enter on the suggestion, the following code is inserted:

 FooBarBar bar = new Bar();

The autocompleter should have detecteded that the rest of "FooBar" is "Bar" which follows the caret, and hence inserted:

 FooBar bar = new Bar();

Conceptually this should simply a case of determining what text remains to be inserted after what has been typed so far ("oBar"), and subtracting from the end of this what is currently typed in ("Bar"), breaking on a space.

This should work on classes, variables, and other types of data with lookups.
Comment 1 Leperous 2015-06-26 09:24:27 UTC
This should also work if the caret is in the middle or the end of some text, looking backwards as well as forwards.
Comment 2 milanka 2016-11-21 15:28:25 UTC
As a workaround try hitting CTRL-enter to autocomplete.