Spacing after typecast in c#

Answered

Resharper turns this "int x = (int) y" to this "int x = (int)y". I prefer the former. How can I make resharper add a space after my type cast?

5 comments
Comment actions Permalink

Hello Kevin,'

I've attached screenshot for this option in 'Code Editing → C# → Formatting Style → Spaces' dialog.
Thanks.



Attachment(s):
screen387.png
1
Comment actions Permalink

Hello,

 

How is this option called/where is it located now?

 

Regards,

Alex

0
Comment actions Permalink

Alex, note this is in Rider but it will be in the same general place within Resharper.

0
Comment actions Permalink

Hello, could you advise what's the name of this setting for the `.editorconfig` file?

I didn't manage to save it from the UI to `.editorconfig`, but only to `.sln.DotSettings` (as `<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">True</s:Boolean>`).

0
Comment actions Permalink

Hello Greg Smulko, the name is "csharp_space_after_cast". This information can also be found here. For more convenient creation/editing of the .editorconfig file, take a look at "ReSharper | Options | Code Editing | General Formatter Style".

Please let me know if you have any questions. Have a great day! :) 

1

Please sign in to leave a comment.