Space after function in visual studio ide

How to set up a customized visual studio to put a space after javascript?

Currently, when I press the return key, I get this

var myfunc = function() { .... }; 

When i want this

 var myfunc = function () { .... }; 

Know its setup somewhere, but cannot find it - it will help with my JSlinting!

+4
source share
2 answers

In VS 2010 you cannot.

The options that you have are in the section "Options-> Text Editor β†’ JScript β†’ Formatting", but this is not one of the available options.

Here are the options you have:

  • Auto formatting
    • Formatting a completed string as you type
    • Format the completed statement to;
    • Formatting a Completed Block}
    • Insert Format
  • New lines
    • Place an open bracket on a new line for functions
    • Place the open bracket on a new line for the control units.
  • Interval - which will have what you after
    • Insert space after comma separator
    • Insert space after comma in 'for' statement
    • Insert space before and after binary operators
    • Insert a space after keywords in control flow statements
+3
source

You cannot do this with VS. I am using VS 2010 and it allows you to write formatting rules starting with Tools -> Options, and then select the Text Editor in the list on the left.

You can define rules similar to the ones you want to use for languages ​​like C #, but not for javascript.

+1
source

All Articles