Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>TODO Highlight v2New to Visual Studio Code? Get it now.
TODO Highlight v2

TODO Highlight v2

Jonathan Clark

|
279,416 installs
| (21) | Free
highlight TODOs, FIXMEs, and any keywords, annotations...
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TODO Highlight v2

License: MIT Version Installs Ratings

Highlight TODO:, FIXME: and any other annotations you wish within your code in VSCode.

Sometimes you forget to review the TODOs and NOTEs you've added while coding before you publish the code to production. This extension highlights them, making them harder to forget. They're shown in the file, in the output channel, and optionally as decorations in the 'overview ruler' too.

They can also be set on a per-language basis.

NB: This extension was started and maintained by wayou until 2018, when it appears to have been abandoned. I, (jgclark) then picked it up in mid-2020, using the significant PR from vonEdfa to add regexes, and also dealt with some other issues in the original repository. See CHANGELOG.md for more details.

Preview

  • with material night color theme:

  • with material night eighties color theme:

Commands

This extension contributes the following commands to the Command palette.

  • Toggle highlight : turn on/off the highlight
  • List highlighted annotations : list annotations to the Output tab (when you have a folder and/or workspace open; when you are working on individual files in one or more editors, the command returns 0 results). Keywords are coloured to match your configured highlight styles.

Installing

You can install the latest version of the extension from the Visual Studio Marketplace.

The source code is available on GitHub.

Top-level Configuration

TODO: and FIXME: are built-in keywords. To add or change keywords and other settings, command + , (or on Windows / Linux: File -> Preferences -> User Settings) to open the VSCode file settings.json.

Alternatively, you can keep settings in a workspace config file at the project root. The extension auto-detects .todohighlight.json or .todohighlight.jsonc, or you can point to a custom file with todohighlight.configFile. Keys in the config file override the same keys in settings.json; both sources work together. Example .todohighlight.json:

{
    "keywords": [
        "TODO:",
        "FIXME:",
        {
            "text": "HACK:",
            "color": "#fff",
            "backgroundColor": "#9b59b6"
        }
    ],
    "include": ["**/*.js", "**/*.ts", "**/*.md"],
    "wholeWordMatch": true
}

For .js config files, export a plain object: module.exports = { keywords: [...] }.

type default description
todohighlight.configFile string (empty) Path to a workspace config file (relative to the workspace root). When empty, auto-detects .todohighlight.json, or .todohighlight.jsonc. File values override matching keys in settings.json.
todohighlight.enableDiagnostics boolean false Enable creating diagnostic entries for open files in the problems view. Default is false.
todohighlight.isEnable boolean true Toggle the highlight, default is true.
todohighlight.isCaseSensitive boolean true Whether the keywords are case sensitive or not.
todohighlight.wholeWordMatch boolean false When enabled, plain-text keywords are only highlighted when they appear as whole words (e.g. BUG: no longer matches the BUG: inside DEBUG:). Can be overridden per keyword with the wholeWord property. Keywords using a custom regex are not affected.
todohighlight.keywords array N/A An array of keywords that will be highlighted. You can also specify the style for each keyword here, and a more advanced regex to detect the item to highlight. See section and examples below for details
todohighlight.keywordsPattern string N/A Specify keywords via regex instead of todohighlight.keywords one by one. NB: if this is present, todohighlight.keywords will be ignored. Remember to escape the backslash if there's any in your regex (using \\ (double backslash) instead of single backslash).
todohighlight.defaultStyle object N/A Specify the default style for custom keywords, if not specified, build in default style will be applied. See all available properties on VSCode doc DecorationRenderOptions section
todohighlight.include array [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.html",
"**/*.php",
"**/*.css",
"**/*.scss"
]
Glob patterns that defines the files to search for. Please add other file types you need, but for performance reasons and to avoid binary files do not use {**/*.*}.
Note that explicitly specifying include patterns will override the default settings, so if you want to add new patterns, and also use the defaults, you will need to include the default patterns as well.
todohighlight.exclude array [
"**/node_modules/**",
"**/dist/**",
"**/bower_components/**",
"**/build/**",
"**/.vscode/**",
"**/.github/**",
"**/_output/**",
"**/*.min.*",
"**/*.map"
]
Glob pattern that defines files and folders to exclude while listing annotations.
Note that explicitly specifying exclude patterns will override the default settings, so if you want to add new patterns, and also use the defaults, you will need to include the default patterns as well.
todohighlight.maxFilesForSearch number 5120 Max files for searching, mostly you don't need to configure this.
todohighlight.toggleURI boolean false If the file path within the output channel is not clickable, set this to true to toggle the path pattern between <path>#<line> and <path>:<line>:<column>.

Configuration for each Keyword

You can override the look by customizing the detailed settings for each Keyword in "todohighlight.keywords" (and similarly the defaults in "todohighlight.defaultStyle"). The available keys and values are:

  • "text": string: without a defined regex pattern this is the string that will be matched
  • "regex": { pattern: "..." } a regex pattern for what will be matched
  • "diagnosticSeverity": controls whether to show a "none", "information" or "error" marker in the overview ruler for each instance of this keyword. Appropriate ones will also be shown in the PROBLEMS panel.
  • "color": colour name (e.g. "green") or other colour code (e.g. "rgba(255,120,0,50)")
  • "backgroundColor": as for color above. Note: setting the last parameter to zero (alpha channel) disables the background colour.
  • "border": CSS string to put a border around the text (e.g. "1px solid red" or "none")
  • "borderRadius": e.g. "2px"
  • "outline": CSS string to put an outline outside the border (e.g. "1px solid red" or "none") -- Note: this is unlikely to be useful, as it will likely overlap with text around the highlight
  • "overviewRulerColor": colour name or colour code to use for this line in the overview ruler
  • "cursor": e.g. "pointer"
  • "isWholeLine": whether the whole line is to be highlighted, or just the matching characters
  • "wholeWord": whether this keyword is only highlighted when it appears as a whole word (e.g. BUG: will not match inside DEBUG:). Overrides the global todohighlight.wholeWordMatch setting for this keyword. Has no effect when a custom regex is supplied.
  • "before": { "contentText": "..." } -- adds text before the highlight. However, note that VSCode may well decide to add another copy of this when moving between open files, so it may have limited value.
  • "after": { "contentText": "..." } -- similarly, adds text after the highlight.

The values used in color, borders, spacing etc. are what VSCode borrows from CSS. For more details see this VSCode documentation). Note that this is not the exactly same as CSS.

You can find a full list of theme colors here: https://code.visualstudio.com/api/references/theme-color.

An example of a custom configuration, showing a range of the different features:

{
    "todohighlight.isEnable": true,
    "todohighlight.isCaseSensitive": true,
    "todohighlight.wholeWordMatch": false, // when true, plain-text keywords only match whole words (e.g. `BUG:` won't match inside `DEBUG:`)
    "todohighlight.maxFilesForSearch": 5120,
    "todohighlight.toggleURI": false,

    "todohighlight.keywords": [
        "FIXME:", // without further details, this will use the defaultStyle
        "REVIEW:", // as will this

        {
            "text": "BUG:", // only highlight `BUG:` as a whole word, so `DEBUG:` is left alone
            "wholeWord": true,
            "color": "#ecf0f1",
            "border": "1px solid #c0392b",
            "borderRadius": "4px",
            "backgroundColor": "#e74c3c"
        },

        // now for a more complex example
        {
            "text": "INFO:", // without a defined regex pattern this is the string that will be matched
            "diagnosticSeverity": "information",
            "color": "green",
            "backgroundColor": "rgba(0,0,0,0)", // INFO: setting the last parameter to zero (alpha channel) disables the background colour
            "border": "none",
            "isWholeLine": false
        },
        {
            "text": "WARNING:",
            "diagnosticSeverity": "warning",
            "before": {
                "contentText": "⚠️" // adds text before the highlight
            },
            "after": {
                "contentText": "⚠️" // adds text after the highlight
            },
            "color": "red",
            "border": "1px solid red",
            "borderRadius": "2px", // NOTE: use borderRadius along with `border` or you will see nothing change
            "backgroundColor": "rgba(0,0,0,.2)",
            "diagnosticSeverity": "warning" // Set diagnostic severity to `none`, `information`, `warning` or `error`
        },
        {
            "text": "TODO(string):", // with a regex pattern defined, this setting isn't used, but is useful as a name for this section
            "regex": {
                "pattern": "(?<=^|\"|\\s)TODO(\\(\\w+\\))?:" // this allows for TODO: or TODO(Bob): etc.
            },
            "diagnosticSeverity": "error",
            "color": "red",
            "border": "1px solid red",
            "borderRadius": "2px", //NOTE: use borderRadius along with `border` or you will see nothing change
            "backgroundColor": "rgba(0,0,0,.2)"
        },
        {
            "text": "NOTE:", // with a regex pattern defined, this setting isn't used, but is useful as a name for this section
            "color": "#ff0000",
            "backgroundColor": "yellow",
            "overviewRulerColor": "grey",
            "regex": {
                "pattern": "(?<=^|\"|\\s)NOTE[:]?(?!\\w)" // in this example, highlight `NOTE:` with or without the `:` and that's not part of another word.  (I.e.: The above will highlight 'NOTE' but not the "note" in 'SIDENOTE').
                /**
                 * Positive lookbehind (`(?<=...)`) is only supported in Node.js v9 and up.
                 * If your VSCode version is built on an earlier version the example above may not work. Simple tests:
                        * Shouldn't work: note  deNOTEd  NOTEing
                        * Should work: NOTE:  "NOTE:"
                 **/
            },
            "isWholeLine": false
        },
    ],

    "todohighlight.keywordsPattern": "TODO:|FIXME:|\\(([^\\)]+)\\)", //highlight `TODO:`,`FIXME:` or content between parentheses
    // NOTE: remember to escape the backslash if there's any in your regexp (using \\\\ instead of single backslash)"

    "todohighlight.defaultStyle": {
        "color": "red",
        "backgroundColor": "#ffab00",
        "overviewRulerColor": "#ffab00",
        "cursor": "pointer",
        "border": "1px solid #eee",
        "borderRadius": "2px",
        "isWholeLine": false,
        //other styling properties goes here ...
    },
    "todohighlight.include": [
        "**/*.js",
        "**/*.jsx",
        "**/*.ts",
        "**/*.tsx",
        "**/*.html",
        "**/*.php",
        "**/*.css",
        "**/*.scss",
        "**/*.md",
        "**/*.mmd",
        "**/*.markdown",
        "**/*.mdown",
        "**/*.txt",
        "**/*.rb",
        "**/*.go"
    ],
    "todohighlight.exclude": [
        "**/node_modules/**",
        "**/bower_components/**",
        "**/dist/**",
        "**/build/**",
        "**/.vscode/**",
        "**/.vscode-test/**",
        "**/.github/**",
        "**/_output/**",
        "**/*.min.*",
        "**/*.map",
        "**/.next/**"
    ]
}

Per-language configuration

The keywords setting can be overridden in per-language configuration settings. In this example, an additional keyword is added for markdown files:

    "[markdown]": {
        "todohighlight.keywords": [
            {
                "text": "BRACKETS:",
                "color": "#000000",
                "backgroundColor": "pink",
                "regex": {
                    "pattern": "(?<=\\{)[^\\}\\n]+(?=\\})" // highlight things in {ss} but not including line breaks
                }
            }
        ]
    }

VSCode's own mechanism

If the type of line or part of a line that you want to change is identifiable by VSCode through a language server -- e.g. comment lines -- then you can use its mechanism as well.

For example to change all comment lines (of all language types) include this in your relevant settings.json file:

"editor.tokenColorCustomizations": {
    "comments": "#82abf7d1",
}

History

This extension was started and maintained by wayou until 2018. jgclark then picked it up in mid-2020, using significant [PR #152 from vonEdfa](https://github.com/wayou/vscode-todo-highlight/pull/152), and dealt with some other issues in the original repository. See CHANGELOG.md for more details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft