Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 500844 - Improved autocomplete feature in Eclipse Java
Summary: Improved autocomplete feature in Eclipse Java
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-05 05:37 EDT by martin shultz CLA
Modified: 2016-09-06 09:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin shultz CLA 2016-09-05 05:37:11 EDT
I am using a translator, if something is not clear, ask.

I would like to ask the developers to improve the auto-complete feature in Eclipse Java SE.

For example, dial the code: e.getSource().toString(); , the cursor is positioned between the "e." and ".getSource().toString();" and at this moment call autocompletion dropdown list. Chose from his example, "getID()". As a result, today it would turn "e.getID()getSource().toString();". And i suggest that there is an automatic removal of the last part up to the point or to the end of the expression, and so we would have: e.getID().toString();.

Still, you can immediately check whether the toString() method of the inserted item and if it is not, it can be removed before the end of the expression (it would turn out e.getID();).

If we would not have inserted between "e.getSource ()." and "toString ();", but now it would be e.getSource().getID()toString ();, but as I suggest: e.getSource().getID();.

It lacks this feature! Or so at least it was possible to include such a mode in the settings. It would be very convenient!
Comment 1 Noopur Gupta CLA 2016-09-06 04:54:22 EDT
"e.getSource().toString();" can be converted to "e.getId().toString();" in the following way:

Place the caret between "e." and "getSource().toString();" and invoke the content assist to select getId(). While the proposal is selected in the popup, press "Ctrl" and then "Enter" to overwrite "getSource()".

To change the default behavior, see: Preferences > Java > Editor > Content Assist > Insertion > Completion Inserts / Completion overwrites.

The information required to check the other part i.e. whether the toString() method is applicable to the inserted item is not available at the time of text replacement.
Comment 2 martin shultz CLA 2016-09-06 09:48:40 EDT
> To change the default behavior, see: Preferences> Java> Editor> Content Assist> Insertion> Completion Inserts / Completion overwrites.

Well, that's what I need! I have not yet fully translated into my language settings in eclipse and perhaps I thought it some other settings. Thank you very much for your help!

> The information required to check the other part i.e. whether the toString ()
method is applicable to the inserted item is not available at the time of text
replacement.

It is a pity that it can not be done, it would be more convenient.