I have an odd behavior with code clean up for c# in visual studio 2008 Team Developer Edition.
Whenever I clean up my code using "Full Cleanup", it replaces all variables declaration with explicit type declarations. But I have set the appropriate settings under "Inspection Severity", "Use var keyword when initializer explicitly declares type" and "use var keyword when possible" to "Show as Error"
Is there any other setting I need to set or is this a known bug?
There's a setting under the Code Cleanup section that specifies what Code Cleanup should do with var
declarations.
In the ReSharper Menu, select Options. At the bottom of the tree view, select Code Cleanup (in the Tools section). Select a Code Cleanup preset on the right, and then look at the Use 'var' in declaration setting. You probably want the Replace direction setting set to Do not change.
This certainly looks like a bug to me. the var=> type usage works but the type usage => var does not on all of the devs machine here at work (R# 4.5). Posting feedback to R# now.
In Build 5.0.1659.36 there is a bug - "Use 'var' in declaration settings" are not respected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With