在代码段中禁用resharper换行符?

问题描述 投票:0回答:1

使用检查,我可以轻松地禁用和恢复resharper重新格式化设置。比如这样:

// ReSharper disable SuggestVarOrType_BuiltInTypes
int i = 1;
// ReSharper restore SuggestVarOrType_BuiltInTypes

所以..有没有办法对换行做同样的事情,这样我可以在我的代码中的特殊位置排长队,还有resharper打破其他人?

基本上,我想,我要求用上面的“SuggestVarOrType_BuiltInTypes”代替秘密:-)

resharper
1个回答
1
投票

尝试使用这些评论:

    // @formatter:wrap_lines False
    {the code block for which you would like to disable wrapping long lines}
    // @formatter:wrap_lines restore

顺便说一句,您可以使用以下方式自行查找大多数格式化程序注释:select needed code block | hit the Alt+Enter shortcut | hit the "Right arrow" key on the "Format selection" item in the menu to open a submenu | hit "Configure" - >它将打开新窗口,显示影响代码块的所有格式化程序设置。

enter image description here

然后欢迎您更改所有您喜欢的设置并单击Save as comments按钮 - >您将获得所需的一切,作为代码块周围的注释。

© www.soinside.com 2019 - 2024. All rights reserved.