6

在 ReSharper 中,我打开了“Wrap Long Lines”,并且所有“Wrap Parameters”选项都设置为“Chop if long”。

如果我有这样一行代码:

DisplayMessage("This is a really long string that cuts off the screen ...", type, item);

ReSharper 想要像这样格式化该行:

DisplayMessage(
    "This is a really long string that cuts off the screen ...",
    type,
    item);

但我希望它像这样格式化:

DisplayMessage("This is a really long string that cuts off the screen ...",
               type,
               item);

这可能吗?我意识到这是因为第一个参数的字符串很长,所以它想把它放在自己的行上,但我更喜欢切碎的参数与左括号一致。

这就像我需要一个[ ] Don't put the first parameter on its own line选择。

4

1 回答 1

3

您要查找的复选框位于:

Code editing -> C# -> Formatting Style -> Line Breaks and Wrapping -> Line Wrapping

并命名为

Prefer wrap after "(" in invocation

你想要它关闭

(但我的 Resharper 显示 2016.2.2 build 13-Sept-2016 作为其版本)

于 2016-10-11T13:19:41.440 回答