Community
Participate
Working Groups
Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list
Since template proposals are merged with code-assist proposals, there are the following options, under the constraint of consistency: 1) Reorder code assist proposals to meet your 'expected' behaviour. Code assist proposals are currently sorted first by category, then by prefix match. We should ask first the code assist people if they share the same view. 2) Leave code assist proposals as is and prepend template proposals to the beginning of the list. This is how it was before. We could use template names which are less likely to collide with types or methods. 3) Leave code assist proposals as is and append template proposals to the end of the list. 4) Don't mess with code assist. Use CTRL-J for code-assist like template selection. I'm still favoring 4), followed by 2).
reverted to proposal 2) we can reopen this bug again, if it turns out to be unsatisfactory.
*** Bug 5991 has been marked as a duplicate of this bug. ***
There has been already a lot of discussions on this, so I summarize the proposals again: 1) Separate key-combo for templates. As you said, this would require some modification in the editor. 2) Display templates at the bottom of the list. The drawback is that in many cases, the user wouldn't even be aware that there are templates at the end of the list. Pressing END is also cumbersome. 3) Be context sensitive. I don't know how (in-)efficient it would be to gather the required context. The context could be: class, method, statement, expression, etc. This would require additional specification by the user when creating a new template. 4) Limit clashes of template names with other proposals. For example rename templates to start with some special character, like '_'. Or be case-sensitive in case of producing template proposals. The way I use code assist I type the first few characters, which rarely clash with a template, so it usually doesn't bother me.
I don't like option 1) as it is something else for me to discover/learn/remember I have the following suggestions (I'm not sure if you get all the information you need from core but you might be able to get it yourself before you call them) a)Don't offer template completions after a '.' That is, if the character before the first character you would replace with the completion is a '.' I don't see a useful reason to have templates in this context. Users expect only valid completions after a '.' b)Order the list to show the "best match" first (typically this will mean you will have to check case). If I complete on 'whi' I want to see the while templates before types beginning with 'Whi' and vise-versa
It looks like we are in agreement that we don't want a separate key-combo. The '.' heuristic is a good start, but it doesn't help when I start typing a local variable that starts with f. Getting a "for" template suggestion is not helpful. Some templates only make sense in the context of a keyword (e.g. while, for) but not all of them. I wonder how we could leverage this. CCing Philippe: what kind of support could code assist offer to provide additional context like "in keyword" (ignoring scheduling constraints)
*** Bug 4361 has been marked as a duplicate of this bug. ***
PM was not added to CC before
in 2.0 Templates have high priorities if code assist is triggered after a whitespace, otherwise the priority is low.