c# - 使用 Visual Studio 2015 禁用注释的自动缩进

标签 c# visual-studio comments resharper auto-indent

我已经查看并搜索了在安装了 Resharper 9.0.0.0 的 Visual Studio 2015 中保存 C# 文件时禁用注释缩进的方法。

我想在开始编写实际代码之前进行伪代码。但是,我一直在调整 Visual Studio 和 Resharper 的设置,但都无济于事。因此,例如我希望评论看起来像:

  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;
     }

当我保存 CTRL + s 结果是这样的:

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;
 }

如何禁用自动格式?

最佳答案

在 VS 2017 (C++) 中有一个复选框。

工具 |选项 |文本编辑器 | C/C++ |格式化 |缩进 |保留评论的缩进

取消选中它修复了烦人的评论自动格式化。 也许 VS 2015 中存在相同的选项。

关于c# - 使用 Visual Studio 2015 禁用注释的自动缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43899505/

相关文章:

sql-server - 如何搭建SQL Server存储过程的开发环境?

c# - 如何禁用 Newtonsoft JSON 序列化程序中的对象引用创建?

c# - ServiceStack + Swagger 以不同方式对资源进行分组的能力

c++ - Visual Studio 2005 中空项目和 win32 控制台项目的区别

c# - 在ubuntu上编译VS2010 c#解决方案(项目)

visual-studio - Visual Studio 2017 中的注释样式

function - 我应该写更多描述性的函数名称还是添加注释?

c# - 在 C# 中组合 ViewStates 或在 C# 中组合泛型列表

c# - 确定矩形是否在圆内的最佳算法

java - 是否可以修改 Eclipse 的注释行为以在当前缩进级别而不是在行的开头添加斜杠?