Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311278

Summary: [content assist] Completion often suggests rarely used classes ahead of frequently used ones
Product: [Eclipse Project] JDT Reporter: Shaun Crampton <shaun>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Shaun Crampton CLA 2010-05-01 06:08:36 EDT
Build Identifier: M20100211-1343

I often find that the eclipse completion engine suggests classes that are very unlikely to be the one that I want and could be easily filtered out either through counting how often different classes are used in my project or the ability to add manual filters.



Reproducible: Always

Steps to Reproduce:
For example: 

  * I start typing "List" and then hit Ctrl-space and the first completion will be java.awt.List rather than java.util.List.

  * I start typing the name of a class in my project, e.g. "StringUtils" and my class is buried in amongst 20 different classes rather than being at the top (stands to reason that I'd want the one in my package).

  * When using the google plugin for eclipse, I often start typing Log.info( and  end up with the wrong logging class as the first option.  In fact, the logging class it suggests prevents the project from compiling, which is a real pain.  I really want to be able to forbid that class from being suggested so that I always get the one I'm expecting.
Comment 1 Remy Suen CLA 2010-05-01 08:10:39 EDT
(In reply to comment #0)
> I really want to be able to forbid that class from being suggested so
> that I always get the one I'm expecting.

If you want to explicitly forbid particular classes or packages, set some type filters in the preferences.
Comment 2 Dani Megert CLA 2010-05-02 01:06:43 EDT
This works fine for me. Note that you are right when it comes to a fresh workspace but after having selected the the list of your choice the first time, it will boost (not filtered - for filtering see Remy's hint) that one in the future (assuming you sort by relevance, which is the default).

There's one issue though related to constructor completion, see bug 261315.


>If you want to explicitly forbid particular classes or packages, set some type
>filters in the preferences.
See Java > Appearance > Type Filters.