Bug 538831 - Make autocomplete sane
Summary: Make autocomplete sane
Status: CLOSED DUPLICATE of bug 481752
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-08 17:12 EDT by Martin Grajcar CLA
Modified: 2018-09-08 22:43 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 Grajcar CLA 2018-09-08 17:12:53 EDT
When I type

    ImmutableSet.of(

Eclipse thinks to know better and changes it into

    ImmutableSet.copyOf()

which es extremely annoying. Note that this "feature" actives when typing `.` and finished when typing `(`, i.e., this happens pretty *always*. Similarly, I always get `flatMap` instead of `map`, despite that I surely use the latter much more often - so it can't be explained by frequency.

IMHO no matter what the settings are, the following rules should be followed:

1. Never replace a correct code piece by something else. Writing `.of(` implies that I wanted just this. If I wanted `copyOf`, I'd write e.g., `.co(`.

2. Always prefer case-matching proposals. As `of` matches `copyOf` only case-insensitively, it should not take preference.

3. Prefer prefix-matching proposals. When I type `.p` and there're methods `.print` and `.copy`, I pretty always want the former.
Comment 1 Stephan Herrmann CLA 2018-09-08 19:23:28 EDT
This pretty much looks like bug 481752 comment 9, which was fixed via bug 483511 (4.6).

Retesting today with Build id: I20180611-0500 it indeed works fine for me.

Please check two things:

(1) In Preferences > Java > Editor > Content Assist > Advanced:
What Default Proposal Kinds do you see selected?
Is Code Recommenders involved? What happens if it is deselected?

(2) At the moment before pressing '(', what is the order of proposals shown? Which proposal appears at the top / first position?
Comment 2 Martin Grajcar CLA 2018-09-08 22:43:48 EDT
> What Default Proposal Kinds do you see selected?
> Is Code Recommenders involved? What happens if it is deselected?

I can't reproduce it at the moment. I was suffering this bug for a long time, and tried hard to find a better setting. Now, it's gone and not reproducible. I'm rather sure, Code Recommenders were on.

> At the moment before pressing '(', what is the order of proposals shown? Which proposal appears at the top / first position?

Sorry, I can't tell anymore.

This non-reproducibility looks like a bug, too. ;)

Closing this for now.

*** This bug has been marked as a duplicate of bug 481752 ***