This question is locked. New answers and comments are not allowed.
Hi guys,
Here's a new issue wth the formatter. Say you type an array initializer:
private string[] _myarray = new[] {"",""};
Typing assistant was kind enough to help me out with double quotes but in the end there are no whitespaces...
I checked my settings and it says to put whilespaces in array initializer wherewhere except for 'Before comma' and it seems to be the default.
Funny enough, selecting this piece of code and hitting Ctrt+Alt+F will bring the spaces back. However, as I remember bare-bones VS does this as you type in this case. By the way, I tried to enable 'Autoformat on semicolon' with no luck..
It's not only an issue with arrays, but it concerns all initializers. Imagine you have a class MyClass with a public property MyProp. Then you are instantiating it like this:
var mc = new MyClass { MyProp = 2|}
The whitespace before MyProp is there because I typed it.
When you hit semicolon it becomes:
var mc = new MyClass { MyProp = 2};|
Something is missing ;)
Here's a new issue wth the formatter. Say you type an array initializer:
private string[] _myarray = new[] {"",""};
Typing assistant was kind enough to help me out with double quotes but in the end there are no whitespaces...
I checked my settings and it says to put whilespaces in array initializer wherewhere except for 'Before comma' and it seems to be the default.
Funny enough, selecting this piece of code and hitting Ctrt+Alt+F will bring the spaces back. However, as I remember bare-bones VS does this as you type in this case. By the way, I tried to enable 'Autoformat on semicolon' with no luck..
It's not only an issue with arrays, but it concerns all initializers. Imagine you have a class MyClass with a public property MyProp. Then you are instantiating it like this:
var mc = new MyClass { MyProp = 2|}
The whitespace before MyProp is there because I typed it.
When you hit semicolon it becomes:
var mc = new MyClass { MyProp = 2};|
Something is missing ;)