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

RSRP-437913: Code Style: Use CRL type name for member access, alias for declaration

$
0
0
Reporter Zdeněk Havlín (Zdeněk.Havlín) Zdeněk Havlín (Zdeněk.Havlín)
Created Apr 21, 2015 10:18:11 AM
Updated Apr 12, 2018 11:18:50 PM
Subsystem Code Style
Assignee Razmik Seysyan (razmik)
Priority Major
State Submitted
Type Feature
Fix version 2017.2
Affected versions 9.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
In ReSharper 9.1, new option raised to use either Keyword or CRL type name for referencing built-in types.

As I stated in discussion https://devnet.jetbrains.com/thread/461833, I would like to see advanced option which will allow me to use CLR type name whenever I access static member on that class (therefore using CLR type name), but for declaring variables and arguments, use alias.

/// <remarks>Ugly example</remarks>
public string GetProductName(string leName)
{
// using alias
string newName;

// using CLR name - accessing method
if (String.IsNullOrEmpty(leName))
{
// using CLR name - accessing static member
newName = String.Empty;
}

return newName.Trim();
}

Original feature request (probably) from #RSRP-5662

Why I made this ticket, rules are:
  • prefer using aliases for built-in types (int, bool, float, string, ...)
  • class name is always PascalCase
  • methods are on classes, not aliases (for me, I don't accept argument that "it is just alias to class")

Current option implemented in 9.1 does allow me only one of the option at same time (or I haven't find how to change that behavior, unless turning it off completely)

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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