Bug 372202 - [chain] support call chain completion on unqualified (not imported) types
Summary: [chain] support call chain completion on unqualified (not imported) types
Status: RESOLVED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Marcel Bruch CLA
QA Contact:
URL:
Whiteboard: deferred
Keywords: helpwanted, plan
Depends on:
Blocks:
 
Reported: 2012-02-22 05:37 EST by Lars Vogel CLA
Modified: 2019-07-24 14:36 EDT (History)
2 users (show)

See Also:


Attachments
Empty result (248.03 KB, image/png)
2012-02-22 05:37 EST, Lars Vogel CLA
no flags Details
Completion on MyView with expected type is ISelection (100.52 KB, image/png)
2012-02-22 06:00 EST, Marcel Bruch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2012-02-22 05:37:14 EST
Created attachment 211389 [details]
Empty result

Call Chain Completion does not work for me. For example in a View I want to access the Workbench Selection:

getSite().getSelectionProvider().getSelection()

If I type:

getS -> Trigger code chain complietion the result is empty, not even getSite() is found.
Comment 1 Marcel Bruch CLA 2012-02-22 06:00:38 EST
Created attachment 211391 [details]
Completion on MyView with expected type is ISelection

Chain completion requires some expected type for a completion, i.e., it has to be triggered on an assignment, or method return etc. See this screenshot for an example.


In your case, no expected type could be determined (there is no assignment or return that could be used to infer your expecation, i.e., the instance you are looking for. Thus, in these cases chain completion does not recommend anything.

Is this an unexpected behavior? What would you expect to see (given that ISelection was not given)?
Comment 2 Lars Vogel CLA 2012-02-22 08:53:41 EST
Thanks, I actually also tried that. Its seems that organize imports needs to run before the call chain gets completed.

Example:

ISelection sel = get -> Trigger shows nothing, if ISelection has not been imported yet

I think a nice addition would be to evaluate the possible imports and show chain evaluation which fits to the possible values. I think that would be much smoother in the usage.
Comment 3 Marcel Bruch CLA 2012-02-22 10:28:21 EST
Yes, that would be great and a nice enhancement.

Switched priority to "enhancement" and added "helpwanted"
Comment 4 Lars Vogel CLA 2014-03-12 11:41:02 EDT
I close this to get it out of my queue, please open another bug in case you plan to work on it.