Resharper foreach - tab order

When I type "foreach" and press tab it immediately takes me to the end location.

eg; foreach ([3]var [2]item in [1]collection)

How can I change this so it goes 1,2,3 instead of 3, 2,1 how it currently does?

1 comment
Comment actions Permalink

Hello,

eg; foreach (var item in collection)

How can I change this so it goes 1,2,3 instead of 3, 2,1 how it
currently does?


By editing the Live Template for "foreach", where field order can be changed.

Might make limited sense though, because the order, which is by the way a
bit different from your sample:

foreach(var item in collection)

Goes this way on purpose.
First you define what you'd iterate (1), then you know the item type for
(2), which in turn gives you the var name (3).
Chahging the order might leave you without reasonable default values for
type and name, they're not known until you give the collection.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

Please sign in to leave a comment.