Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 insists on inserting spaces in JavaScript

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() {};
like image 243
Lance Fisher Avatar asked Apr 26 '10 19:04

Lance Fisher


2 Answers

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.

like image 67
xinqiu Avatar answered Sep 19 '22 06:09

xinqiu


You should find these settings here:

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

like image 45
ignaZ Avatar answered Sep 22 '22 06:09

ignaZ