0

Visual Studio autoformat places a new line after all block comments - at least the one I am using. It does so obviously only for those comments, which come first on a line.

/*mark1*/ double[] a = new /*mark2*/ double[100]; 

is formated to:

/*mark1*/ 
double[] a = new /*mark2*/ double[100];  

Since I am using inline block comments as marks for a code replication tool, I want to disable that 'feature' for all block comments. Auto format should simply ignore them.

/*mark1*/ double[] a = new /*mark2*/ double[100]; 

should not break the line while auto formatting.

Is this possible and how? I tried everything in the "New Lines" section in the C# formatting settings, but without luck.

user492238
  • 4,094
  • 1
  • 20
  • 26
  • see this duplicate question http://stackoverflow.com/questions/626439/how-do-i-turn-off-visual-studios-formatting-options – Adeel Feb 17 '11 at 04:57
  • @Adeel: please read the question. This is not a duplicate. I am not asking for "ignoring spaces in declaration statements", but not to insert new lines after inline block comments. – user492238 Feb 17 '11 at 05:00
  • 2
    oops :( its my fault. sorry SO Users – Adeel Feb 17 '11 at 05:03
  • @Adeel: you must have true fans, voting up such a comment – user492238 Feb 17 '11 at 06:15

2 Answers2

0

I suppose, it's simply not possible.

user492238
  • 4,094
  • 1
  • 20
  • 26
0
#pragma warning disable IDE0055
        /*mark1*/ double[] a = new /*mark2*/ double[100];
#pragma warning restore IDE0055

Hackish way, because there is no proper way to set up formatting for this, so why not just temporarly disable formatting. You can also use #pragma warning disable format

Eric Liu
  • 585
  • 1
  • 7
  • 11