Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-287619: Inconsistent formatting of indexer properties in interface

$
0
0
Reporter Nathan Alden (Nathan.Alden) Nathan Alden (Nathan.Alden)
Created Jan 6, 2012 6:54:04 AM
Updated Jan 6, 2012 6:55:06 AM
Priority Normal
Type Unspecified
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
I have attached my DotSettings file. If I define an interface with regular properties, Full Cleanup does not insert a space in between each property:

public interface IMyInterface
{
  int X
  {
    get;
  }
  int Y
  {
    get;
  }
}

However, if I insert an indexer property, Full Cleanup inserts spaces unnecessarily:

public interface IMyInterface
{
  int X
  {
    get;
  }

  int this[int v]
  {
    get;
  }

  int Y
  {
    get;
  }
}

This behavior is inconsistent; the fact that a property is an indexer does not warrant the whitespace normally afforded only to methods defined on multiple lines; i.e.:

public interface IMyInterface
{
  int X
  {
    get;
  }

  void MyMethod(
    int x,
    int y);
}

Honestly, I don't like the forced extra line at all. My preference is to divide groups of properties, methods and events with a single line, but no lines between each declaration within a group.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>