Visual Studio 2010坚持要在JavaScript中插入空格 [英] Visual Studio 2010 insists on inserting spaces in JavaScript

查看:231
本文介绍了Visual Studio 2010坚持要在JavaScript中插入空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio 2010在关键字function和下面的括号之间插入一个空格。有可能把这个关掉吗?即

Visual Studio格式化我的代码:

  var vsfn = function(){}; 

我想要这样的格式:

  var myfn = function(){}; 


解决方案

VS2010 sp1引入了一个新选项:
中的匿名函数的关键字工具>选项>文本编辑器> JScript>格式>间距。您可以将其关闭以获得所需的行为。


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() {};

解决方案

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.

这篇关于Visual Studio 2010坚持要在JavaScript中插入空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆