Visual Studio 2010 insists on inserting spaces in JavaScript

末鹿安然 提交于 2019-12-12 08:26:14

问题


Visual Studio 2010 inserts a space between the keyword "function" and the following parenthesis. Is it possible to turn this off? i.e.

Visual Studio formats my code like:

var vsfn = function () { };

I would like this formatting:

var myfn = function() {};

回答1:


VS2010 sp1 introduced a new option: Insert space after function keyword for anonymous functions in Tools > Options > Text Editor > JScript > Formatting > Spacing . You can turn it off to get the desired behavior.




回答2:


You should find these settings here:

Tools > Options > Text Editor > JScript > Formatting > Spacing



来源:https://stackoverflow.com/questions/2716095/visual-studio-2010-insists-on-inserting-spaces-in-javascript

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