Getting more space between your variables and their declarations in C#

Let’s say you want to keep your formatting rules enabled, but want to get some additional space between your variables and their declarations. You can put a C-style inline comment in the whitespace between the two. For example,

class Class1

{    int/**/ a = 1;    int/**/ b = 2;


Note that you could do something like this, by adding the spaces after hitting the semicolon at the end.


            a = 1;   

However, if you ever format the document, format that selection, do something on that line to invoke formatting (like re-entering the semicolon), the line will go back to



  a = 1;   Tags: VSTipsSuggest a Tip!
Comments (1)

  1. Alan McFarlane says:

    Err, maybe I’m misunderstanding, but has the bottom of this article been lost.  "However…will go back to".  Err what’s the tip…?

    Also the "Suggest a Tip!" link is broke, in the source it is  about:/saraford/contact.aspx