Sean
Sean

Reputation: 62492

Visual Studio 2015 Property Formatting

When I enter automatic properties C# properties in Visual Studio 2015 it insists of formatting them like this:

public int Age {get;set;}

I don't want the space after the "e" and before the "{", I want it to look like this:

public int Age{get;set;}

I didn't have this issue in VS2013, and even though I've exported my settings from VS2013 and imported them into VS2015 it still insists on inserting that space!

No matter what formatting options I select I can't seem to get it to do what I want. Does anyone know what crazy option combination I need to select to get it to stop putting the space in?

Upvotes: 0

Views: 353

Answers (1)

Orel Eraki
Orel Eraki

Reputation: 12196

This automatic properties is part of the Visual Studio Code Snippet.

You should edit the default behavior for prop:
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\Visual C#\prop.snippet

And change:

<Code Language="csharp"><![CDATA[public $type$ $property$ { get; set; }$end$]]>

To:

<Code Language="csharp"><![CDATA[public $type$ $property${ get; set; }$end$]]>

Upvotes: 2

Related Questions