Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an option in ReSharper to add a blank line after a closing bracket

Tags:

c#

resharper

I would like to add a blank line after a closing bracket inside of a method. I cannot find a setting for this. Here is some sample code.

What I have:

if (something != null) {
    something = 1;
}    
var andThen = 2;

What I want:

if (something != null) {
    something = 1;
}

var andThen = 2;

edit: I have version 8.1.23.546.

like image 370
Shaun Bowe Avatar asked Mar 04 '14 15:03

Shaun Bowe


2 Answers

No, that is not possible in ReSharper, at least not in version 7.0.1.

There is nothing of the kind in Formatting Style -> Braces Layout, nothing in Formatting Style -> Blank Lines and nothing in Formatting Style -> Line Breaks and Wrapping.

like image 61
Roy Dictus Avatar answered Oct 14 '22 15:10

Roy Dictus


I just wanted to comment that this will be fixed in version 2017.3 of R# and that it is already fixed in R# 2017.3 EAP 7 which can be downloaded from here.

Updated C# Formatting Style options for blank lines before and after statements with blocks, control transfer as well as multiline statements.

This can be configured in the R# options under Formatting Style => Blank Lines => Before/After statements with child blocks.

like image 36
Gabriel Lozano-Moran Avatar answered Oct 14 '22 17:10

Gabriel Lozano-Moran