Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the beginning of a curly brace to a new line in Visual Studio 2015?

I am writing/debugging Javascript code in Visual Studio 2015 and hate to have the curly braces of a function starting at the end of an expression (btw: why is it like this as it is way less clearly arranged?) like:

$scope.adjusted = function () {
    console.log(adjustedYesNo);
}

Instead I want to have it started by default (and after each change) in the beginning of a line like:

$scope.adjusted = function () 
{
    console.log(adjustedYesNo);
}

Where to set such a setting in Visual Studio 2015?

like image 646
Joey Avatar asked May 05 '16 09:05

Joey


2 Answers

In the menu go to...

Tools > Options > Text Editor > JavaScript > Formatting > New Lines

Set the options as required in there. You can do this individually for each of the supported languages.

like image 142
Reinstate Monica Cellio Avatar answered Nov 15 '22 02:11

Reinstate Monica Cellio


Go to:

Options -> Text Editor -> Javascript -> Formatting - > New Lines -> Braces

  • and there are two checkmarks about braces on new line
like image 42
Ceylan Mumun Kocabaş Avatar answered Nov 15 '22 02:11

Ceylan Mumun Kocabaş