2016-08-16 10 views
4

在ReSharper中,我打開了「換行」,所有「換行參數」選項都設置爲「如果長時間換行」。如何強制ReSharper始終將第一個參數放在與該方法相同的行上?

如果我有這樣一行代碼:

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選項。

回答

1

你正在尋找的複選框被放置在:

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

,並命名爲

Prefer wrap after "(" in invocation

,你想它關閉

(但我ReSharper的顯示2016.2 .2構建2016年9月13日版)

相關問題