An exhaustive clean line of code destroys properties and fields

Here is my problem. I want to put line breaks between properties, not fields.

Here is what I get:

private string _field1; private string _field2; private string _field3; public string Property1 { get; set; } public string Property2 { get; set; } public string Property3 { get; set; } 

Here is what I want:

 private string _field1; private string _field2; private string _field3; public string Property1 { get; set; } public string Property2 { get; set; } public string Property3 { get; set; } 

Does anyone have an idea how to get Resharper to have this type of line breaks? Currently, I have that Resharper puts line breaks between all fields and properties, with or without line breaks. It seems I canโ€™t find the right settings to get what I want.

+7
source share
2 answers

Go to ReSharper | Options and under Code Editing , go to C # and rarr; Formatting Style โ†’ Empty Strings . Now you need to change two separate parameters:

  • Change Save Maximum Empty Lines In Code To 0 (zero)
  • Change the value Around the field of one row to 0 (zero)

... and you're done!

+4
source

You may also need to make sure that Save existing line breaks is not checked under Line breaks and wrap .

+1
source

All Articles