[Feature Request] Blank lines around File Layout Entries

When setting “Keep max blank lines in declarations” to 0, all fields get merged into one block. I suggest to add the option to keep declaration sections split automatically. Using File Layout Entries for this purpose seems very natural since they are an existing way of defining code sections.

Desired:

private readonly Type _field1;
private readonly Type _field2;
private readonly Type _field3;

[Attribute] private Type _field4;
[Attribute] private Type _field5;

public Type Property1 => _field1;
public Type Property2 => _field2;
public Type Property3 => _field3;

Current:

private readonly Type _field1;
private readonly Type _field2;
private readonly Type _field3;
[Attribute] private Type _field4;
[Attribute] private Type _field5;
public Type Property1 => _field1;
public Type Property2 => _field2;
public Type Property3 => _field3;

Alternatively, Rider could somehow deduce code sections when rearranging members with “Keep max blank lines in declarations” set to 1. At the moment it is unclear to me how Rider decides when to move a blank line with the field and when not - in any case the sections get scrambled.

Related posts:

How to insert blank line between sections when rearranginng code? - Marked as answered but has no comments.

0
1 comment

Hello Jacek,

Thanks for your feedback. Your suggestion is covered in this feature request: RSRP-496458 Code cleanup. Blank lines between member groups. We currently have no immediate plans to implement this. You may upvote to receive further updates. 

Thanks,

Tom

0

Please sign in to leave a comment.