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

查看:44
本文介绍了使用 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,菜单 Options代码编辑C#格式样式换行符和包装.

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

并禁用换行:

这真的让我发疯了!

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

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