Bug 478197 - for loop completion should propose all the possible applicable variables
Summary: for loop completion should propose all the possible applicable variables
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 11:00 EDT by Pascal Rapicault CLA
Modified: 2015-09-24 07:23 EDT (History)
3 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 2015-09-23 11:00:12 EDT
When I use the for template (e.g. the for - iterate over a collection), the code added makes use of a random field to instance the template. 
Once this has happened, I have to go and modify the added code and in the end, the template did not really helped me that much.

Instead of picking a field to use for me, it would be best if I was being presented with all the variables that could be used in the context of this template. This way, the added code is immediately ready to be used.
Comment 1 Stephan Herrmann CLA 2015-09-23 13:43:43 EDT
Mh, when I select the foreach loop template in the context where several iterable variables are in scope, I just tab to the variable and select from a list of offered choices.

Are you not seeing that list when to tab to it?
Comment 2 Pascal Rapicault CLA 2015-09-23 22:41:30 EDT
Well you just showed me a new feature :)

But I think it is not really user friendly:
- You have to complete (ok), then hit tab twice before the list gets shown. Just this aspect is not really intuitive because once the code got generated it is not clear how you can get it to change (even though you have the boxes surrounding the main sections) and even less so that you can go to the list.

IMO, it would be a better user experience if once the content of template has been filed in the drop down with the list of possible types was to be shown. This way it is clear to the user that it is possible.
Comment 3 Stephan Herrmann CLA 2015-09-24 07:23:23 EDT
(In reply to Pascal Rapicault from comment #2)
> Well you just showed me a new feature :)

My pleasure! But: really? You have been around some time ... :)

> But I think it is not really user friendly:
> - You have to complete (ok), then hit tab twice before the list gets shown.
> Just this aspect is not really intuitive because once the code got generated
> it is not clear how you can get it to change (even though you have the boxes
> surrounding the main sections) and even less so that you can go to the list.

If that feature is not discovered by users we seem to have a fundamental problem, because that's the key concept for all "linked" proposals (all those that have little boxes around text).
 
> IMO, it would be a better user experience if once the content of template
> has been filed in the drop down with the list of possible types was to be
> shown. This way it is clear to the user that it is possible.

The point is: we have several locations where the user can select or edit the proposed text before the proposal is finalized.

I could imagine, however, to improve this by checking if one of the edit positions has a list to offer, and if so, select this position first.


Dani, Markus, would you support such change? If so, should it apply to all linked proposals? I guess we cannot make it specific to "for" loops, because it's just a regular template proposal, right?

It *might* annoy seasoned users, who blindly start typing once linked mode has been entered: they will be surprised that edits go into a different position than they did previously.