Can I Have R# Ignore 'Object and Collection Initializers'?

Answered

I want to use 'Cleanup Code', but I don't want Resharper to touch my object or collection initializers (found in Code Editing | C# | Formatting Style | Line Breaks and Wrapping

e.g.:
new C()
{
  PropertyX = 1,
  PropertyY = 2,
  PropertyZ = 3
}

I want Reshaper to reformat most things, but this particular one I don't want it to touch. The 'Chop Always' is too much, and the 'Simple Wrap' and 'Chop If Long Or Multiline' are too little (btw the 'Chop if Long' choice never seems to chop even with pretty long lines). I'd like it to just leave these alone, but the dropdown doesn't have a choice for 'None'.

Is there any way to tell Resharper to leave my object/collection initializers alone?

Thanks!

 

0
1 comment
Official comment

Hello Andy,

Feel free to comment and vote for https://youtrack.jetbrains.com/issue/RSRP-391165 feature request.

Thanks!

Please sign in to leave a comment.