Code Verification Resharper suggests using var in C # instead of an explicit type almost everywhere. I do not like this parameter because too many var makes things unclear, so I turned off this option. However, when I like to use var, in cases of initialization twice the type on the same line with generics (so in similar situations, like the diamond operator from java 7), for example:
Dictionary<string string> dic = new Dictionary<string, string>();
I made my own template in Resharper:
Dictionary<$type1$, $type2$> $id$ = new Dictionary<$type1$, $type2$>();
with replacement by:
var $id$ = new Dictionary<$type1$, $type2$>();
This works fine, but the pattern also finds strings that have already been converted with the rule. Why and how to fix it?
Edit: put part of the text in bold because no one is reading it.
c # visual-studio resharper var
user968698
source share