Home > Shared Source, Visualization > Visualization – Comment Highlighter

Visualization – Comment Highlighter

March 10th, 2011

Occasionally you may need to note a place in a source file that needs to be revisited later for correction or improvements. There are three standard codes used to designate such places: TODO, HACK and UNDONE. Visual Studio has the built-in Task List tool window, which shows the list of such comments. To open the list, go to View menu -> Task List:

Visual Studio Task List

The list of the presented comments in the window can be tweaked on the “Environment -> Task List” page inside Visual Studio options dialog (Tools -> Options…).

CodeRush offers an additional visualization feature to highlight the most often used TODO comments, called Comment Highlighter. This feature paints the ” TODO:” comment part in a low-contrast color, and the rest of the to-do text in a different, higher-contrast color. The highlighting works in both CSharp and Visual Basic, and disappears once comment is activated, in other words, the editor caret is inside of a comment. This is what it may look like:

CodeRush Comment Highlighter preview

On the other hand, you are able to change the colors used for highlighting of such comments instead of contrast adjustment, for example:

CodeRush Comment Highlighter preview (custom colors)

These options can be changed on the Editor | Painting | Comment Highlighter options page in the IDETools Options Dialog (DevExpress -> Options…):

CodeRush Comment Highlighter options page

Don’t forget that there are code templates you may use for creating fast comment areas , like “/t” for “// TODO”, “/h” for “// HACK”, etc.

The feature resides in the open source “CR_CommentHighlighter” plug-in from the CodeRush Shared Source solution. This allows you to add other comments to be highlighted or improve the current implementation. The plug-in is not installed if you have version 10.2.5 or earlier of IDE Tools. You have to compile it manually from the Shared Source solution, located in your installation folder, e.g.

C:\Program Files\DevExpress 2010.2\IDETools\System\CodeRush\SOURCES\Shared Source.sln

In version10.2.6 and up of CodeRush Pro, this plug-in is installed, but disabled, by default. You can enable it on the options page mentioned above.

Products: CodeRush Pro
Versions: 10.2 and up
VS IDEs: any
Updated: Mar/10/2011
ID: C079

Similar Posts: