使用ReSharper的Visual Studio自动格式化中的换行和换行 [英] Break lines and wrapping in auto formatting of Visual Studio with ReSharper

查看:492
本文介绍了使用ReSharper的Visual Studio自动格式化中的换行和换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#项目并使用Visual Studio 2012.当Visual Studio尝试格式化我的代码时,它会断行并使我的代码看起来难以阅读.原始代码(对于我和我的团队来说,看起来很不错):

I'm working in a C# project and using Visual Studio 2012. When Visual Studio tries to format my code, it breaks lines and make my code look difficult to read. The original code (what looks pretty nice to read for me and my team):

if (list.Any(x => x.Type == (int) EnumType.Customer))
{

}

当Visual Studio尝试格式化时:

And when Visual Studio tries to format:

if (
    list.Any(
        x => x.Type ==
                (int) EnumType.Customer))
{
  // Other break codes
}

还有很多其他地方破坏了我的代码.我喜欢某些部分的自动格式化,但是我的问题是:有没有办法在Visual Studio中禁止这种中断线自动格式化?*

There are a lot of other parts where it is breaking my code. I like auto formatting for some parts, but my question is: Is there a way to disable this break lines from auto formatting in Visual Studio?*

PS:我还安装了ReSharper.

PS: I also have ReSharper installed.

推荐答案

长行解决方案:

ReSharper,菜单选项代码编辑 C#格式样式换行符包装.

ReSharper, menu OptionsCode EditingC#Formatting StyleLine Breaks And Wrapping.

并禁用换行:

这真的让我发疯了!

这篇关于使用ReSharper的Visual Studio自动格式化中的换行和换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆