c# formatting


If I have a long lin like this

var name = Method(LongEnumType.WithALongMemberName, anotherLongVariableName, etc etc);

Resharper reformat breaks is up like this (only when Method(..) can fit on a single line)

var name = 
  Method(LongEnumType.WithALongMemberName, anotherLongVariableName, etc etc);

I would like to break it up like this

var name = Method(LongEnumType.WithALongMemberName, 
  anotherLongVariableName, etc etc);


I can't find the setting that changes this. Can you help?


Hello Karsten,

thank you for contacting us.

Please take a look at the following feature request: https://youtrack.jetbrains.com/issue/RSRP-484370/C-Formatter.-Ability-to-add-line-breaks-both-before-and-after-the-parenthesis-in-method-invocations-when-wrapping-long-lines

Does it describe behavior that you would like to have?

Thank you


I don't think so, but thanks for the suggestion.


Hello Karsten,

I believe the following set of settings might help you with the desired formatting: ReSharper | Options | Code Editing | C# | Formatting Style | Line Breaks and Wrapping | Arrangement of Invocations

Also please check the following useful feature to detect the formatting rules and settings based on a provided source example: https://www.jetbrains.com/help/resharper/Configure_Code_Formatting_Rules.html#formatting-rules-from-existing-code

Thank you!


Please sign in to leave a comment.