C# Curly Brace Formatting Visual Studio 2017

Multi tool use


C# Curly Brace Formatting Visual Studio 2017
I'm new to Visual Studio Code and I have moved there from Atom since I'm learning C#. This is also my first time posting a question here, so pardon me if I haven't done a good job.
for(int i = 1; i < args.Length; i++){<cursor>}
I want to be able to press enter and the code should look like:
for(int i = 1; i < args.Length; i++)
{
<cursor>
}
I know other people have faced similar problems but I've researched for hours and fiddled around with the setting to no success. I am using Visual Studio 2017, latest version.
Please ask questions if you need any more information. Thanks!
you can use snippet for "for" loop. Write down "for" and press the tab button twice.
– habib
22 mins ago
So where it is not working - in VS Code or VS2017 (you wrote VS2017 in header, but also - "I'm new to Visual Studio Code ")? In VS2017 it is working like you've described.
– SeM
18 mins ago
1 Answer
1
First thing comes to my mind - after writing your code press Ctrl+K+D.
It will layout your code.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Press enter after the ( and then type { and it will make {} press enter again and you will get the format you wanted
– BugFinder
22 mins ago