ReSharper 函数头代码格式化

ReSharper functionheader code formating

我在 VS2015 中使用 ReSharper。我想在代码格式设置中做一些更改,但我没有得到我想要的。

例如我使用这样的函数:

public static MyFunction(int one, string two, double three)
{
....
}

当我点击保存并且该行很长时,代码将被格式化为这样。

public static MyFunction(
    int one, 
    string two, 
    double three)
{
....
}

但我想要的是这个

public static MyFunction(
                         int one, 
                         string two, 
                         double three)
{
....
}

我想调用函数的时候也这样格式化。 那么有没有可能像上一个一样格式化它?可以在 ReSharper 选项中找到正确的设置。

感谢您的帮助

我强烈建议您不要尝试像这样格式化代码。没有允许这样做的 resharper 设置。保留第二个选项:

`public static MyFunction(
    int one, 
    string two, 
    double three)
{
....
}`

这完全没问题,当您按照自己的意愿格式化代码时,我发现没有任何附加值。

但是,如果您真的非常想要它,您可以创建自己的 Custom code inspection 这并不是您要找的东西,因为您不会在格式化时得到结果,而是在调用 resharper 的代码检查时得到结果。