Resharper formatting chained method

允我心安 提交于 2019-11-30 18:36:08

With Resharper 7.1.2, you can get the following formatting:

var foo = new FooDataBuilder().WithDate(myDate)
                              .WithBar(myBar)
                              .Build();

By setting the following Resharper options:

Code Editing->C#->Formatting Style->Line Breaks and Wrapping->Line Wrapping->Wrap chained method calls to Chop always

and

enable Code Editing->C#->Formatting Style->Other->Align Multiline Constructs->Chained method calls

I don't think you can align with FooDataBuilder() unless you do it manually. (This has been confirmed by @Dmitry Osinovskiy from Jetbrains so this may be the closest you're going to get to what you want.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!