使用检查,我可以轻松地禁用和恢复resharper重新格式化设置。比如这样:
// ReSharper disable SuggestVarOrType_BuiltInTypes
int i = 1;
// ReSharper restore SuggestVarOrType_BuiltInTypes
所以..有没有办法对换行做同样的事情,这样我可以在我的代码中的特殊位置排长队,还有resharper打破其他人?
基本上,我想,我要求用上面的“SuggestVarOrType_BuiltInTypes”代替秘密:-)
尝试使用这些评论:
// @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"
- >它将打开新窗口,显示影响代码块的所有格式化程序设置。
然后欢迎您更改所有您喜欢的设置并单击Save as comments
按钮 - >您将获得所需的一切,作为代码块周围的注释。