问题描述
当我在安装了Resharper 9.0.0.0的Visual Studio 2015中保存C#文件时,我已经寻找并寻找了禁用注释缩进的方法.
I have looked and searched for ways to disable indentation of comments when I save C# files in Visual Studio 2015 with Resharper 9.0.0.0 installed.
在开始编写实际代码之前,我想伪代码.但是,我一直在调整Visual Studio和Resharper的设置,但均无济于事.因此,例如,我希望注释看起来像:
I'd like to pseudocode before I start writing actual code. However I have been tweaking with both Visual studio's and Resharper's settings to no avail. So for example I want the comments to look like:
private string ToggleString(string input)
{
// If input.length is between 1-100
// All the uppercase letters converted to lowercase.
// All the lowercase letters converted to uppercase
// else
// Return a constructive message.
return input;
}
当我保存 + 时,结果如下:
When I save + it turn out like this:
private string ToggleString(string input)
{
// If input.length is between 1-100
// All the uppercase letters converted to lowercase.
// All the lowercase letters converted to uppercase
// else
// Return a constructive message.
return input;
}
如何禁用自动格式化?
How do I disable the auto-format?
推荐答案
在VS 2017(C ++)中,有一个复选框.
In VS 2017 (C++) there is a checkbox for this.
工具||选项|文字编辑器| C/C ++ ||格式化压痕保留评论缩进
Tools | Options | Text Editor | C/C++ | Formatting | Indentation | Preserve indentation of comments
取消选中该选项可修复烦人的评论自动格式设置.也许VS 2015中存在相同的选项.
Unchecking it fixed annoying comment auto-formatting.Maybe the same option exists in VS 2015.
这篇关于使用Visual Studio 2015禁用注释的自动缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!