Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Selection and TODO Highlighter

Selection and TODO Highlighter

Yves Goergen

|
10,531 installs
| (17) | Free
Highlights other occurrences of the selected text and TODO words in the editor and scroll bar margin.

Overview

This extension for Visual Studio 2022 lets you easily find where the selected text also occurs in the current document. You select the text you want to search, and all other occurrences of the same text are highlighted automatically, as seen in this description. The other places are indicated in the scroll bar margin to give you an overview. (This behaviour is known from the text editor application Notepad++.)

Additionally, all occurrences of TODO keywords are highlighted with a different colour in the editor as well as the scroll bar margin. This allows you to quickly write an open issue directly into the code – and notice it again later!

Collapsed code regions also show the highlighting colour so that it is easily visible where such occurrences or keywords exist.

Demo.png

(The screenshot also features the Indent Guides extension and a bit of syntax colour customisation available since VS 2019.)

Previous versions

Version 1.0 of this extension only supports Visual Studio 2019. It doesn't seem to accessible anymore after I updated to version 2.0 here, so you can get it from here.

For previous versions of Visual Studio you might find my older extension “TODO Highlighter” interesting.

About TODO

Although not recommended, it is common practice to use comments with the “TODO” keyword throughout new code to indicate that something remains to be done in a certain place. And they serve as a good skeleton when writing down code for a work item, then adding the implementation details for each part of it. These comments mostly look like other explanatory inline comments and are hard to find again unless you actually perform a text search for the keyword. This extension makes these keywords easily visible so that you quickly see where is work left to do before publishing the code.

TODO keywords as well as other occurrences can optionally be ignored within comments or strings of the source code.

Configuration

The appearance and behaviour of this extension can be configured in the standard Visual Studio settings dialog window. The colours are customisable through the section “Fonts and Colors”, the other behaviour can be changed in the section “Selection Highlighter”, both under “Environment”.

The following colours can be set:

  • Selection highlighting: The colour of the selected text that is currently highlighted.
  • Selection occurrence highlighting: The colour of all other occurrences of the selected text.
  • Selection occurrence margin: The colour of the dot that is placed in the scroll bar margin for every occurrence.
  • TODO highlighting: The colour of TODO keywords in the editor.
  • TODO margin: The colour of the dot that is placed in the scroll bar margin for every TODO keyword.

The background colour sets the highlighting fill, and the foreground colour sets the border around that highlighting. Set the foreground to “Standard” to hide the border.

The following options can be configured:

  • Use highlighting for selection occurrences or TODO keywords, separately.
  • Show occurrences or keywords in the scroll bar margin. If disabled, the scroll bar width is not increased.
  • Select or search whole words.
  • Select letters or digits only.
  • Keep the occurrences highlighting visible after the selection has been cleared.
  • Delay between selection and highlighting.
  • Include comments or strings for highlighting, separately.
  • Search case-sensitively.
  • The TODO words to highlight. Multiple words can be configured and will be highlighted according to the other options. Specify them as regular expression like for example "Word1|Word2|Word3|Xyz[0-9]+".
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft