Blu*_*eft 10 c# resharper formatting visual-studio-2008
有时(但不总是!?)当我使用分号粘贴或结束一行时,Visual Studio将在if语句后添加一个空格!例如,粘贴时,这个
if()
Run Code Online (Sandbox Code Playgroud)
将变成这样:
if (condition)
Run Code Online (Sandbox Code Playgroud)
并且,当完成一行时,这个
if(condition)
DoSomething()
Run Code Online (Sandbox Code Playgroud)
将变成这样:
if (condition)
DoSomething();
Run Code Online (Sandbox Code Playgroud)
不得不经常删除这个空间(有时两次!)正在推动我绝对的Bonkers! 这似乎发生同if和while,但不会for.
我在VS选项中找不到与此相关的任何内容.我安装了Resharper,但设置为不自动添加空间:

为什么Visual Studio会惩罚我?
Jon*_*eet 19
在Visual Studio选项的"文本编辑器/ C#/格式/间距"下的"设置其他间距选项"部分中,有一个"在控制流语句中插入关键字之后的空格"选项.
我怀疑你会发现你已经检查了,你不希望它被检查.(我故意检查:)
根据需要禁用自动格式化。
工具->选项->文本编辑器->C#->格式->常规。
默认情况下,在我的 C# Express 2010 配置中检查所有内容: