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

Bug 338096

Summary: Feature Request (Templates): Proposals on an assignment
Product: z_Archived Reporter: Johannes Lerch <lerch>
Component: RecommendersAssignee: Marcel Bruch <marcel.bruch>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P5 CC: marcel.bruch
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Johannes Lerch CLA 2011-02-24 09:55:31 EST
I expect to get template proposals triggering code completion in this situation:
final Button b = <^Space>

Test case provided in class CompletionOnAssignment in fixture project: org.eclipse.recommenders.tests.fixtures.rcp.codecompletion.templates
Comment 1 Stefan Henss CLA 2011-02-25 01:37:48 EST
I see that "final Button b" is given in completionNodeParent() and getExpectedType() is correctly set. But the receriverName is empty and receiverType is null. The second one is not problem but will the receiverName be available from the context?
Comment 2 Marcel Bruch CLA 2011-02-25 02:34:14 EST
code completion is not triggered on any "name". If I would assume that "b" is the receiver name I would exclude any other statements like method returns as in chain completion would return. I guess you have to take this information from the LocalDeclaration or its superclass AbstractVariableDeclaration.
Comment 3 Marcel Bruch CLA 2012-02-02 01:55:24 EST
FWIW, getCompletionNodeParent() now contains the information about the assignment, i.e.,

"final Button b = <CompleteOnName:>;"

We should keep this in mind when updating the template completion during M6.

Setting the status to new again as there has been no progress for a year. Stefan, if you would like to migrate the template completion for M6 and fix this issue please reassign it to you.  Thanks, Marcel
Comment 4 Marcel Bruch CLA 2013-12-01 09:48:19 EST
Closing as wont fix as there is no one working on this one and we have no plans to support it in 2.x yet.