Community
Participate
Working Groups
If the current text selection is an expression that evaluates to an Iterable or array, then any templates containing ${iterable} (for example, the 'foreach' template) should be offered when the templates content assist is invoked. Example: void printMappings(Map<?, ?> map) { map.entrySet() } When the expression 'map.entrySet()' is highlighted and Ctrl+Space is pressed twice, the 'foreach' template should be offered. When invoked, the 'foreach' template would alter the code thusly: void printMappings(Map<?, ?> map) { for ([Entry<?, ?>] [entry] : map.entrySet()) { | } } The square brackets denote editable template fields, and the pipe character denotes the final cursor position when the template mode is exited cleanly. It would be nice if the element type field would still have the drop-down list giving a choice among the possible assignable types. If this enhancement request is implemented correctly, I think it would already do this "for free."