Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of the "name"-variable behind #region

I searched all around, but I can't find the option to change the color of "name" after #region in VS2012.

For example if I have the following code:

#region Test some code

CallSomeCode();

#endregion

How do I change the color of Test some code?

like image 397
2-Lee Avatar asked Feb 03 '13 12:02

2-Lee


2 Answers

After looking at this and other posts on the Internet, this is what worked in VS 2015 for me:

#region and #endregion keywords: Preprocessor Keyword [immediately applied]

Text after the #region keyword: Preprocessor Text [immediately applied]

Collapsed region: Collapsed Text (Collapsed) [must restart Visual Studio]

enter image description here

like image 124
TxCsharper Avatar answered Oct 02 '22 14:10

TxCsharper


In VS 2012 the following worked for me:

  • To change color of #region / #endregion - set 'Preprocessor Keyword'
  • To change the text after #region when collapsed- set 'Collapsed Text (Collapsed)'
  • To change the text when expanded - set 'Plain Text', but beware this also changes ; ( [ etc

You may need to restart VS to take effect

Personally I wish there was two types of comments - one for disabling code, and one for explanatory remarks. They are two very different things but generally treated the same in most languages

like image 25
userSteve Avatar answered Oct 02 '22 13:10

userSteve