Bug 11023 - Filter code assist choices based on context
Summary: Filter code assist choices based on context
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-08 09:38 EST by Randy Hudson CLA
Modified: 2003-02-14 09:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2002-03-08 09:38:46 EST
For example:
java.util.List list = new A<<CODE ASSIST>>

would suggest ArrayList only, because other Types are not instances of List.  
This could probably be special cased for assignment as above, and maybe more 
generic in the future such that:

setLocation( new Po<<CODE ASSIST>> showed only subTypes of Point().
Comment 1 Erich Gamma CLA 2002-03-11 08:35:02 EST
this is on our un-committed list for 2.0. We will not filter but intend to use 
sorting. The basic support has to come from JDT Core.
Comment 2 Philipe Mulet CLA 2002-03-28 05:44:36 EST
We will add an extra parameter in ICompletionRequestor callback API to denote 
the relevance of the completion candidate, which will discriminate on the 
following criteria:

- case matching
- expected type matching (i.e. completion in right-hand side of assignments)
- visible vs. non-visible
- unqualified vs. qualified completions for types

We do not promise in a first cut to address the completion inside method call 
scenario (provide completions which match respective parameter types), but this 
can be added later on.

Description of the supported scenarii will be added to this note.
Comment 3 Philipe Mulet CLA 2002-04-10 06:03:28 EDT
Other scenario: exception type should have better relevance if 
containing "exception" or "error" in their name.

Comment 4 David Audel CLA 2002-04-29 06:42:06 EDT
If the completion identifier and proposal are equal and the case match then the 
proposal relevance grow.

If the completion is inside a super type in type declaration header then the 
relevance grow when the type have the correct nature : 
   After extends keyword of a class header the relevance grow if the type is a 
class. 
   After implements keyword of a class header the relevance grow if the type is 
an interface. 
   After extends keyword of an interface header the relevance grow if the type 
is an interface.

If the completion is inside a type in a catch or throws clause the relevance 
grow when the type is an exception (if the name of the type contain exception 
or error).

If the completion is inside a throw statement the relevance grow when the 
proposal is an exception. 
Comment 5 Philipe Mulet CLA 2002-05-14 09:01:18 EDT
Downgrading priority, some of the relevance is in already. Rest will happen 
post 2.0
Comment 6 Philipe Mulet CLA 2002-06-11 08:25:50 EDT
Defer
Comment 7 Philipe Mulet CLA 2002-06-11 08:38:23 EDT
Defer
Comment 8 Philipe Mulet CLA 2002-06-11 08:39:36 EDT
Defer
Comment 9 Philipe Mulet CLA 2003-02-14 09:36:49 EST
CodeAssist relevances are now used for sorting.
Closing
Comment 10 Philipe Mulet CLA 2003-02-14 09:47:03 EST
Closing