morkan
morkan

Reputation: 171

Curly brackets indention in Visual Studio for Mac

I use Visual Studio for Mac and the curly brackets in my code are not indented automatically and they are aligned to the left.

Have somebody encountered this issue? How can I fix it?

here.

Upvotes: 8

Views: 3104

Answers (3)

Matt Sponholz
Matt Sponholz

Reputation: 1

To resolved this, I went to: Preferences-> Source Code-> Code Formatting-> C# Source Code

Under Policy, Select "Microsoft Visual Studio" Click Ok Restart Visual Studio.

Then you should be set!

Upvotes: -2

Gokalp Altun
Gokalp Altun

Reputation: 188

  1. Open the Preferences
  2. Select Source Code
  3. Under the Source Code; Select Code Formatting
  4. Select C# Source Code
  5. New page popped-up
  6. Select C# Format tab in the new page then press the Edit button
  7. Change Indention to New Lines in the Category section

Now, you can set your custom format settings as you want...

First Page Popup Page

Upvotes: 16

Ken Tucker
Ken Tucker

Reputation: 4156

To Format Existing Code in Visual Studio for Mac

Highlight the code and in the edit menu select Format --> Format Selection.

To Adjust the Auto Formatting Settings in Visual Studio for Mac

In the Visual Studio Menu Select Preferences --> Source Code. --> Code Formatting --> C# Formatting. There is an option to select a few Policy one of them is Visual Studio

Visual Studio for Mac C# format settings

Upvotes: 3

Related Questions