Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper clean code line breaks with properties and fields

Tags:

resharper

Here is my issue. I want to put line breaks between properties and not fields.

Here is what I am getting:

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? What I currently have is that the Resharper puts lines breaks between all of fields and properties or no line breaks. I cannot seem to find the right settings to get what I want.

like image 522
chafnan Avatar asked Mar 07 '12 16:03

chafnan


1 Answers

Go to ReSharper|Options and under Code Editing, navigate to C#→Formatting Style→Blank Lines. Now, you need to change two separate options:

  • Change the Keep max blank lines in code value to 0 (zero)
  • Change the Around single line field value to 0 (zero)

... and you're done!

like image 106
Dmitri Nesteruk Avatar answered Oct 02 '22 21:10

Dmitri Nesteruk