can I make foreach template default to use explicit type instead of var?

Currently I have to go back, select var, and use "Specify type explicitly".

I'd like to default to specifying the type explicitly.

2 comments
Comment actions Permalink

Hello Derek
     Which version of ReSharper are you using? When expanding the foreach template ReSharper should offer you to choose between 'var' and explicit type when you're on the $TYPE$ variable. Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

6.1.

I do have the option to change it, but it always starts with var.  If it didn't start with var, I wouldn't have to change it.


        public void ProcessNames(List<string> names)
        {
           foreach ( var name in names )
           {
              
           }

This code seems silly to me...  I know it is a matter of preference, but I think maybe there should be a global setting to reduce resharper's enthusiasm about "var" :)

0

Please sign in to leave a comment.