Bug 491090 - Completion should propose all types compatible with the expected argument
Summary: Completion should propose all types compatible with the expected argument
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-05 10:13 EDT by Pascal Rapicault CLA
Modified: 2016-04-12 00:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2016-04-05 10:13:29 EDT
I have the following code
EObject eobject = ...;
eobject.eAdapters().add(new |);

When I hit the completion where the '|' is located, the only choice I get proposed with is the type of the argument. In this case I get proposed with an interface called Adapter (which is correct). 

However this is not super helpful because I know there are some subtypes that are more interesting to me and I can't see them. In this particular case, the completion should also show me the set of subtypes of Adapter like EContentAdapter, etc.
Comment 1 Jay Arthanareeswaran CLA 2016-04-06 03:45:18 EDT
Pascal, there has to be something about your set-up; let's find out. What's the signature of the eAdapters() like? I have something like this and I get all relevant proposals including the sub types of Adapter.

class EObject<T> {
	public List<T> eAdapters() {
		return new ArrayList<>();
	}
}

Do you have a lambda somewhere in the code? Can you try pulling this into a small class?
Comment 2 Pascal Rapicault CLA 2016-04-08 07:39:06 EDT
No lambdas, nothing too fancy. Just the code snippet I showed you.
Note that EObject is coming from EMF.core and Adapter from EMF.common.

I've been able to reproduce this again.
Comment 3 Jay Arthanareeswaran CLA 2016-04-12 00:50:04 EDT
(In reply to Pascal Rapicault from comment #2)
> No lambdas, nothing too fancy. Just the code snippet I showed you.
> Note that EObject is coming from EMF.core and Adapter from EMF.common.
> 
> I've been able to reproduce this again.

Will you be able to share that code where this happens? TIA!