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?

0
5 comments

Hello Kevin,'

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



Attachment(s):
screen387.png
1

Hello,

 

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

 

Regards,

Alex

0

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

0

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

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! :) 

2

Please sign in to leave a comment.