Project
ReSharper
Priority
Normal
Type
Feature
Fix versions
Mirabile Futurum
State
Open
Assignee
Evgeny Pasynkov
Subsystem
Psi
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Lasse V. Karlsen
    5 years ago (05 Aug 2006 02:08)
  • Updated by   Ashley Oliver
    2 months ago (10 Mar 2012 22:57)
  • Jira: RSRP-5662
    (history, comments)
 
RSRP-5662 Option to use class names instead of C# keyword for data types
8
Issue is visible to: All Users
  The issue is visible to the selected user group only
I'd like an option so that I can ask Resharper to use the system class names instead of the C# keywords.

In other words, I'd like Resharper to use "String", "Int32", "Int16", "Byte" etc. instead of the keywords "string", "int", "short", "byte".

This would mean that refactoring and similar expansions that auto-generate the data types would need to support this.
Comments (8)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Christian Eitner
  Christian Eitner
07 Aug 2006 17:23
5 years ago
Re: #5662- Option to use class names instead of C# keyword for data types
I'll second this. Our organizational policy forces me to do so, which now means that I have to 'correct' some of ReSharper's formatted code (I don't want to use the formatting, though).

In the extreme, I would like to see options for each of the mentioned types (e.g., whether to use 'Object' or 'object', 'Int32' or 'int', etc), with two overriding schemes for .NET versus C# types.

Also on the nice side would be to have 'Nullable<ValueType>' instead of 'ValueType?'.
Christian Eitner
  Christian Eitner
07 Aug 2006 19:26
5 years ago
Re: #5662- Option to use class names instead of C# keyword for data types
I'll second this. Our organizational policy forces me to do so, which now means that I have to 'correct' some of ReSharper's formatted code (I don't want to use the formatting, though).

In the extreme, I would like to see options for each of the mentioned types (e.g., whether to use 'Object' or 'object', 'Int32' or 'int', etc), with two overriding schemes for .NET versus C# types.

Also on the nice side would be to have 'Nullable<ValueType>' instead of 'ValueType?'.
Ashley Oliver
  Ashley Oliver
08 Sep 2011 20:44
8 months ago
Another vote for this. It's so inconsistent to see, for example, a method signature like:

MyReturnType MyMethod(SomeType a, AnotherType b, SomethingElse c, bool d, YetAnother e);

with 'bool' looking completely out of place, particularly with the different colours for the syntax highlighting. I wouldn't want to change the colour for 'keywords', because it's useful to have keywords (like 'if', 'else', 'for') a different colour. When specifying types of variables or arguments however, I want a type name, not a keyword that is an alias for a type, and for it to be highlighted as a type, not a keyword.
Michel Bretschneider
  Michel Bretschneider
04 Nov 2011 15:07
6 months ago
I second that. Our style guide says CLR typenames and it's very annoying to fix extracted/generated methods and properties by hand. This even goes for loop snippets (foreach) where you can only choose between var and the language type name.
Graham Street
  Graham Street
08 Nov 2011 00:10
6 months ago
I third this (or fifth it). Would like to see Type names and not keywords for bool, string, int etc. Should be Boolean, String, Int32.
Yuri Astrakhan
  Yuri Astrakhan
01 Mar 2012 23:12
2 months ago
I think this should not be the default behavior because having "String" in code requires "using System;" at the top. Which might be a minor issue, but if it is not needed, why have it? Keywords are always there, and do not produce ambiguity. Having a possibly unneeded "using" might introduce additional complexities (such as if some 3rd party library having some type with the same name as in System)
Julien Lebosquain
  Julien Lebosquain
02 Mar 2012 12:50
2 months ago
I'd like an alternative between the two if you implement this some day. I personally always use keywords to define a member or variable (eg int i), but always use class names for members calls (eg Int32.TryParse).
Ashley Oliver
  Ashley Oliver
10 Mar 2012 22:57
2 months ago
@Yuri: That isn't strictly true. ReSharper can just do what it always does when generating a reference to a type for which you haven't added a using statement - fully qualify the type name and use for example System.String instead. Not that I mind what the default setting is, just that there should be a setting for those of us who want type names instead of keywords.