Reputation: 2957
I setup Visual Studio to remove all spaces in C# code, also around declarations/assignments.
I want
int x = 5;
to be automatically formatted like
int x=5;
In Visual Studio 2010 this works fine, the "Ignore spaces in declaration statements" option is off. In Visual Studio 2017 many spaces are removed per my settings, e.g. around "+" or ",", but not assignments. I can enable "Ignore spaces in declaration statements", then at least it will not insert the spacing upon triggering autoformat, but I would like it to automatically remove them. Is this a regression to Vs2010?
I have unchecked all checkboxes for inserting spaces and chosen "Remove spacing before and after binary operators"
The same issue happens with Visual Studio 2013
Upvotes: 3
Views: 1065
Reputation: 447
You should look in Tools --> Options --> Text Editor --> C# --> Formatting --> Spacing and then change the option under "Set Spacing for Operators".
Upvotes: 2