Visual Studio.NET 2010 javascript格式

Mat*_*ols 3 javascript formatting visual-studio-2010

在Visual Studio.NET 2010中,编辑器在函数关键字和参数集之间插入一个空格,如下所示:

function (event, ui)
Run Code Online (Sandbox Code Playgroud)

无论如何我都找不到它完全禁用javascript格式,其中大部分都是我喜欢的.虽然我确信有些人喜欢这种惯例,但事实并非如此.

我也安装了Resharper 5.1.3000.12,但似乎不太可能,因为Resharper还不支持javascript.

如果无论如何对如何解决这个问题有任何想法,我将不胜感激.

干杯,马修

cap*_*gon 7

Why don't you like it? Is it aesthetics while programming or for better performance in production? If your reason is performance I'd let the IDE do whatever it wants while developing and then run an obfuscator that will compress the code. I use YUI Compressor.

EDIT #1

Since you've mentioned it's aesthetics, you can go to Tools -> Options... -> Text Editor -> JScript -> Formatting. and turn off all the automatic formating and spacing.

example: 在此输入图像描述


Pav*_*uva 7

打开选项,然后转到文本编辑器 - > JScript - >格式化.取消选中"在匿名函数的函数关键字后插入空格":

在此输入图像描述