Forum Visual Studio

Hi, What C# Formatting option controls this behaviour?

Hi,

I'm a new Xamarin Studio user (was using Unity's build-in Monodevelop until 2 days ago). I like my braces on new lines:

if( something )
{
}

However the IDE insists I put braces on the same line as the if. Here's what it's doing:
1) I'm about to hit ENTER and start a curly brace: http://www.screencast.com/t/Rg9Cg5RmeJi
2) So far so good: http://www.screencast.com/t/6VCKMLMgYt7
3) I hit ENTER and try to enter my closing brace. The IDE then auto snaps my starting brace back to the end of the if() line: http://www.screencast.com/t/qwFgDMMdsYDZ

Why is it doing that and can I change it so it doesn't modify my starting brace?

My C# formatting options are:
Braces: http://www.screencast.com/t/GHFc3GqHPh
Wrapping: http://www.screencast.com/t/3wiW39z9
New Lines: http://www.screencast.com/t/68Gvv5MggUN

Thanks in advance,
Jeff

Answers

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Did you set the formatting policy in preferences or on the solution? When you create a solution, the policies are copied into the solution, so everyone working on a solution gets the same policies.

  • JChowdownJChowdown USMember

    Hi Michael,

    I'm doing it through this: Preferences -> Source_Code > Code_Formatting -> C#_Source_File

Sign In or Register to comment.