Alex Saesee
Alex Saesee

Reputation: 129

Visual Studio IntelliSense - change method creation

First off all, sorry if this question already exist but my english is limited for this task.

I use Visual Studio on C# and of course, IntelliSense.

When I write a new method, an If or any other "method/constructor", IntelliSense write like that (when I press Tab or Enter to validate the suggestion)

Actual result :

if (true)
{
    // code
}

private void Test()
{
    // code
}
// ...

What I want :

if (true) {
    // code
}

private void Test() {
    // code
}
// etc. ...

See what I want to do ? I prefer the second 'theme', most readable for me and row economizer.

Is an option behind, hidden in the dark side of VS to do that ?

Thanks for help.

Upvotes: 0

Views: 74

Answers (2)

MarcinJuraszek
MarcinJuraszek

Reputation: 125650

You can set that on Options window:

Tools -> Options -> Text Editor -> C# -> Formatting -> New Lines

Upvotes: 1

Tim
Tim

Reputation: 15247

Seems you're asking for javascript style formatting here. I found this link that might help.

1.Click Tools | Options…

2.Scroll down to the Text Editor node

3.Expand the C# node

4.Expand the Formatting node

5.Click on the New Lines node

6.You will see a list of options like in the image below which give you full control over when Visual Studio should put your open brace on a new line

Upvotes: 1

Related Questions