How do you make Visual Studio/CodeMaid insert newlines before and after #region and #endregion?

1.3k views Asked by At

When I hit Ctrl+E+D or Ctrl+M+Space (CodeMaid), I want Visual Studio to add newlines before and after #region and #endregion in following languages: C#, CSS, JS

How I can make it happen?

For ex:

#region

Codes

#endregion

BTW, now Visual Studio remove any inserted enter on #regions.

2

There are 2 answers

0
Steve Cadwallader On

By default, CodeMaid will insert blank line padding before/after #region and #endregion statements. There is additional logic that will prevent that from happening based on the surrounding context (e.g. if it's the first item inside a set of braces).

Note: This only applies to C#. I'm not sure what you mean by CSS and JS as neither of those languages support #pragma statements to my knowledge.

0
LeRoy On

By default, it's enabled if not you can make sure it's green enter image description here