History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-23751
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Bas Leijdekkers
Reporter: Dmitry Avdeev
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

"Iterate through..." intentions

Created: 09 Nov 07 15:20   Updated: 06 Dec 07 15:45
Component/s: Editor. Intention Actions
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 0


 Description  « Hide
At a variable or field of Collection or array type (or even method call with iteratable return type) provide "Iterate through..." intentions creating foreach, indexed or iterator loop

 All   Comments   Work Log   Change History      Sort Order:

Dmitry Avdeev - 09 Nov 07 16:05
IMHO one-click intentions would be more convenient (and easily foundable)

Taras Tielkes - 09 Nov 07 16:13
I think you're right.

I assume, you're suggesting a single intention, that tries to be as smart as possible (by looking at current reference)?


Dmitry Avdeev - 09 Nov 07 16:23
I mean there could be two or three intentions depending on the position:
  • foreach/indexed loop for arrays
  • foreach/iterator loop for collections
  • foreach/iterator/indexed loop for lists

Taras Tielkes - 09 Nov 07 20:51
For java.util.Map you might suggest
  • iterate map keys
  • iterate map entries

In addition java.util.Enumeration could be supported.


Taras Tielkes - 09 Nov 07 21:01
Some other ideas...
  • If expression on which intention is invoked is part of a statement, I assume iteration statement would be generated immediately following the current statement
  • However, it would also be convenient to simply compose some (collection-yielding) expression on a new line, and then invoke the intention from that. It this case iteration statement would really be generated "around" the expression (instead of: as next statement)