Request for extra options in C# 'Arrangement of Member Access Expressions'
Hello
I would like to request some extra options to the 'Arrangement of Member Access Expressions' under 'Code Editing' -> 'C#' -> 'Line Breaks and Wrapping'.
I have for my integration tests some test data builders that I would like to have formatted as follows:

Unfortunately this is not possible with the current options. It could however maybe resolved by adding the following options:
- Prefer wrap before '.'
- Keep existing arrangements
When I choose to 'Chop always' this is how the above block of code is arranged, depending on the setting(s) to wrap long lines:

I have also noticed that the arrangement is not automatically applied during typing and hitting <Enter>. As far as I know automatic arrangement is working for other things such as braces layout, ...
Please sign in to leave a comment.
Hello Gabriel!
Thank you for the feedback.
Here's correspondent feature request - https://youtrack.jetbrains.com/issue/RSRP-471556.
Please feel free to contact us in case of any questions or problems.
Thank you.
Hi Gabriel!
I'm sorry I don't completely understand your request. To signify that you want a wrap before '.', just turn off "Prefer wrap after '.'". To keep existing arrangements, set "Wrap chained method calls" to "Chop if long or multiline" (or to "Simple wrap"). What is really needed to achieve your formatting style is an option for a line break right before a first chained method call. I'll try to implement it later.
Hello Dimitri, that is what I need but at the same time I don’t want to chop a ‘simple’ chained method call like:
var person = new PersonBuilder().WithLastName(“Lozano”).Build(true);
Should not be formatted to:
var person = new PersonBuilder()
.Build(true);
Also when chopping it should chop the entire chain and not just chop on the ‘long’ lines. I don’t know if you understand what I mean.
I am sorry for reviving this old post of mine after almost 1.5 years, but I am still facing the same issues. Let me illustrate with an example of what I am trying to accomplish.
I have the following code (it is one of our integration tests) that is formatted the way I want it to be formatted:
R# cannot detect the formatting style (Alt + Enter => Format Selection => Detect Formatting Settings):
The best I can do with code cleanup and automatic formatting is this but I want the code to be wrapped where I higlighted it with the red arrows:
Can this formatting be done with the options we currently have in the latest version of R#?