Resharper not changing type to var

Answered

Even with the three options in "var usage in declarations" set to "use var" and "notify with" set to "error", Resharper still doesn't change types to var in declarations. I'm running full cleanup with "enforce var keyword usage settings" set to yes, and it doesn't change anything.

It also doesn't show up as an issue when I have the file open in the editor, and hitting alt-enter on the type doesn't show any options to change it to var.

6 comments
Comment actions Permalink
Official comment

Hello TK

Have you changed default values to "use var" for all available settings ("For built-in types", "For simple types" and "Elsewhere")? 

Thanks! 

Comment actions Permalink

Yes, I normally don't use var for built-in types but I tried setting all of them to var just to check, and even with everything set to "use var" it still didn't change it. Also when I set it to use the explicity type instead of var, it didn't change the var to the type.

0
Comment actions Permalink

Hello Thore,

Do any other ReSharper inspections work in the same file? 

Thanks! 

0
Comment actions Permalink

Yes, everything else seems to work fine.

0
Comment actions Permalink

Then please export all R# settings (ReSharper | Manage Options | "Export to file" for each layer) and share it with me by creating a new support request via "Submit a Request" button above. 

0

Please sign in to leave a comment.