问题描述
ReSharper的确实表明我VAR-关键字的使用。不幸的是,我的新雇主不使用VAR-关键字可言。这就是为什么我有一些麻烦,因为我习惯了使用var-关键字。
Resharper does suggest me the usage of the var-keyword. Unfortunately, my new employer does not use var-keyword at all. Thats why I am having some trouble, because I am used to use the var-keyword.
是否有可能让ReSharper的做相反的事情吗?因此,它警告我,每次我使用var关键字,并建议我明确地声明变量?
Is it possible to let resharper do the opposite thing? So, it warns me everytime I use the var keyword and suggests me to declare the variable explicitly?
在此先感谢!
编辑:\
我不希望关掉警告或者类似的东西,我希望把这一设置身边,所以我会得到一个警告每当我使用VAR
I dont want to turn off the warning or something like that, I want to turn that Setting around, so I will get a warning whenever I'm using var.
推荐答案
从工具栏上方点击ReSharper的 - 代码编辑 - - 选项C# - 代码样式你会发现变种使用声明,那么你需要设置首选项为使用显式类型为内建类型,简单类型'和; 。在别处
From the toolbar at the top click Resharper - Options - Code Editing - C# - Code Style you will find 'var usage declarations' you then need to set the preference to 'Use explicit type' for 'Built in types', 'Simple Types' & 'Elsewhere'.
这篇关于ReSharper的暗示VAR的使用 - 它可以做相反的事藏汉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!