开发者

Visual Studio.NET 2010 javascript formatting

In Visual Studio.NET 2010 the editor keeps inserting a space between the function keyword and the parameter set like this:

function (event, ui)

I can't find anyway to turn it off with out disabling javascript formatting entirely, most of which I like. While I am sure some folk like this convention, I do not.

I also h开发者_StackOverflow社区ave Resharper 5.1.3000.12 installed, but it seems unlikely as Resharper doesn't support javascript yet.

If anyway has any thoughts on how to fix this I would appreciate it.

Cheers, Matthew


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:

Visual Studio.NET 2010 javascript formatting


Open Options, then go to Text Editor -> JScript -> Formatting. Uncheck "Insert space after function keyword for anonymous functions":

Visual Studio.NET 2010 javascript formatting

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜