Visual Studio Code - Colored Regions Extension

Visual Studio Code - Colored Regions Extension

21 June 2020, 18:00
Flavio Javier Jarabeck
4
729

There are times when you have blocks of - let's say - permanent things inside an indicator that must not be removed or at least I have to look carefully before editing... Having more comments over those areas not always is the right solution, so I searched for something more visual in the Visual Studio Code Marketplace and found this pretty cool extension that put colors on blocks of code, using just a keyword in a comment line...

The extension is called "Colored Regions" by Jaša Mihelčič - Extension Link Here...



Through the use of a simple tag name you can color whatever the region you want in your code, example:



Just use the #region and #endregion with your favorite tag and Presto!

In mine I used the keyword "DoNotRemove"... For this to happen, after installing the extension you should put a little piece of code setting this tag in your settings.json VSC file:


    "coloredRegions.namedColors": {
        
        "DoNotRemove": "rgba(0,125,125, 0.2)"
    },


I hope this helps your coding...

And thanks again to Jaša Mihelčič for this simple and smart extension!


Live Long and Prosper



Share it with friends: