space after function in visual studio ide

让人想犯罪 __ 提交于 2019-12-23 12:08:06

问题


How can I set up the designed in visual studio to put a space after my javascript functions?

At present when I press the return key I get this

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

When I want this

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

Know its a setting somewhere but cant find it - will help with my JSlinting!


回答1:


In VS 2010 you can't.

The options you have are found at "Options-> Text Editor -> JScript -> Formatting", but that is not one of the options available.

Here's the options you have:

  • Automatic Formatting
    • Format completed line on Enter
    • Format completed statement on ;
    • Format completed block on }
    • Format on paste
  • New lines
    • Place open brace on new line for functions
    • Place open brace on new line for control blocks
  • Spacing - section that would have what you're after
    • Insert space after comma delimiter
    • Insert space after semicolon in 'for' statement
    • Insert space before and after binary operators
    • Insert space after keywords in control flow statements



回答2:


You can't do it with VS. I am using VS 2010 and it permit you to write formatting rules going on Tools -> Options and then select Text Editor in the list on the left.

You can define rules like the one you want for languages like C# but not for javascript.



来源:https://stackoverflow.com/questions/4011285/space-after-function-in-visual-studio-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!