我们有一个代码风格检查器,它在每次 checkin 之前运行,要求 C# if 语句的格式如下:
if (condition)
但是,我的肌肉内存力已经可以打字了:
if(condition)
有什么方法可以让 Visual Studio 2010 在我键入没有空格的情况下自动插入该空格?我知道你可以设置它,当你粘贴代码时,它会自动执行此操作,但不会在键入时自动执行。谢谢!
最佳答案
工具
> 选项
> 文本编辑器
> C#
> 格式化
> 间距
然后选中/勾选 Insert space after keywords in control flow statements
,它列在 Set other spacing options
子组下。
赢了。
关于c# - Visual Studio : Automatically insert a space after typing if(,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5398051/