tags:

views:

73

answers:

1

When I type the semicolon, ReSharper does certain things to the line of code I've just authored. Can I include in those actions the removing of the explicit type specification (and replacing it with "var")?

string foo = ""

... and then I type the semicolon, and the line of code is automatically re-written as follows?

var foo = "";

EDIT: I'm using 4.5 -- I'll move to 5.x soon.

A: 

I use "Clean Up Code" in Resharper to make the changes. But I use var everywhere possible anyway - so it only makes a difference to old code. I think it is worth getting youyr settings for "Clean Up Code" just right and applying it to all of your code - it means that the style is always consistent and diffs are always consistent.

open-collar