Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
No Fix versions
State
Open
Assignee
Bas Leijdekkers
Subsystem
Editor. Intention Actions
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Dmitry Avdeev
    4 years ago (09 Nov 2007 16:20)
  • Updated by   root
    2 years ago (17 Jan 2010 20:55)
  • Jira: IDEADEV-23751
    (history, comments)
 
IDEA-41916 "Iterate through..." intentions
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
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
Comments (6)
 
History
 
Linked Issues (?)
 
Taras Tielkes
  Taras Tielkes
09 Nov 2007 16:41
4 years ago
Dmitry Avdeev
  Dmitry Avdeev
09 Nov 2007 17:05
4 years ago
IMHO one-click intentions would be more convenient (and easily foundable)
Taras Tielkes
  Taras Tielkes
09 Nov 2007 17:13
4 years ago
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
  Dmitry Avdeev
09 Nov 2007 17:23
4 years ago
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
  Taras Tielkes
09 Nov 2007 21:51
4 years ago
For java.util.Map you might suggest
  • iterate map keys
  • iterate map entries

In addition java.util.Enumeration could be supported.
Taras Tielkes
  Taras Tielkes
09 Nov 2007 22:01
4 years ago
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)