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?
Please sign in to leave a comment.
Hello Kevin,'
I've attached screenshot for this option in 'Code Editing → C# → Formatting Style → Spaces' dialog.
Thanks.
Attachment(s):
screen387.png
Hello,
How is this option called/where is it located now?
Regards,
Alex
Alex, note this is in Rider but it will be in the same general place within Resharper.
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>`).
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! :)