-
Notifications
You must be signed in to change notification settings - Fork 145
Configuration Examples
If you are modifying the settings directly in settings.json
you'll need to escape the backslashes, as shown in these examples. If you are using the setting GUI, you only need one backslash.
Note: I haven't personally tested all of these, so you may need to make further tweaks. https://regex101.com/ is a useful website for experimenting.
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|\\*>|^......\\*)\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (//|#|<!--|;|/\*|\*>|^......\*)\s*($TAGS)
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|!|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (//|#|<!--|;|/\*|!|^|^[ \t]*(-|\d+.))\s*($TAGS)
"todo-tree.regex.regex": "((--\\s*($TAGS))|\\{-\\s($TAGS).*(\\n.*)*-})"
or in the settings GUI:
Todo Tree: Regex: Regex ((--\s*($TAGS))|\{-\s($TAGS).*(\n.*)*-})
"todo-tree.regex.regex": "(//|#|<!--|/\\*|^\\s*\\*)\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (//|#|<!--|/\*|^\s*\*)\s*($TAGS)
It will match
//
#
<!--
-
/*
, -
*
(for JSDoc)
Also works with JS, BASH, PHP, HTML, CSS, MD, JSON, XML.
"todo-tree.regex.regex": "((//|#|<!--|;|/\\*|^|%|\\\\)\\s*($TAGS)\\{*|^\\s*- \\[ \\])",
or in the settings GUI:
Todo Tree: Regex: Regex: ((//|#|<!--|;|/\*|^|%|\\)\s*($TAGS)\{*|^\s*- \[ \])
Note: For LaTeX, you will probably also want to add the tag todo
(lowercase), or set todo-tree.regex.regexCaseSensitive
to false.
"todo-tree.regex.regex": "--\\[\\[[\\s|\\n|\\r]*($TAGS)[\\s|\\n|\\r]*\\]\\]|--\\s*($TAGS)",
or in the settings GUI:
Todo Tree: Regex: Regex: --\[\[[\s|\n|\r]*($TAGS)[\s|\n|\r]*\]\]|--\s*($TAGS)
It will match
--
-
--[[
]]
-
--[[
]]
The following config is useful if you want to highlight incomplete/complete TODOs.
"todo-tree.regex.regex": "((//|#|<!--|;|/\\*|^)\\s*($TAGS)|^//\\s*\\[x\\]|^//\\s*\\[ \\])",
"todo-tree.general.tags": [
"TODO",
"[x]",
"[ ]",
],
"todo-tree.highlights.customHighlight": {
"[x]":{
"foreground": "#64dd17",
"background":"#008800"
},
"[ ]":{
"foreground": "#f44336",
"background": "#592c2c",
},
}
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|\\(\\*)\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (//|#|<!--|;|/\*|^|\(\*)\s*($TAGS)
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|\\(\\*|--)\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (//|#|<!--|;|/\*|^|\(\*|--)\s*($TAGS)
To match standard @todo
tags:
"todo-tree.regex.regex": "(//|#|<!--|;|/?\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)",
"todo-tree.general.tags": [
"@todo",
"TODO",
"FIXME"
]
To also match standard todo!()
macros:
"todo-tree.regex.regex": "((//|#|<!--|;|/\\*|^)\\s*($TAGS)|($TAGS)!.*)",
"todo-tree.regex.regexCaseSensitive": false,
- PUG comments:
//- TODO: PUG EXAMPLE
(\/\/-|
) - BAT comments:
REM TODO: BAT example
(REM|
) - Markdown list:
- TODO: Markdown Example
(-|
)
"todo-tree.regex.regex": "((\/\/|\/\/-|#|<!--|;|REM|\/\\*|^|-)\\s*($TAGS))"
or in the settings GUI:
Todo Tree: Regex: Regex: ((\/\/|\/\/-|#|<!--|;|REM|\/\*|^|-)\s*($TAGS))
"todo-tree.regex.regex": "(\"\\s|//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: ("\s|//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS)
"todo-tree.regex.regex": "('|//|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)"
or in the settigns GUI:
Todo Tree: Regex: Regex: ('|//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS)
As long as your annotations end with a :
you can try: "todo-tree.regex.regex": "((\\s|^)($TAGS):)"
or in the settings GUI:
Todo Tree: Regex: Regex: ((\s|^)($TAGS):)
These get quite complex, so you can try the following to see if they work for you...
"todo-tree.regex.regex": "(?:(?://|#|<!--|;|/\\*\\*?|\\*)\\s*($TAGS)|^\\s*- \\[ \\])"
"todo-tree.regex.regex": "((//|#|;|\\*)[ ]*($TAGS)[^\\n]*)|(/\\*(\\*?\\s*)*($TAGS)(.|\\n|\\r)*?\\*/)|(<!--\\s*($TAGS)(.|\\n|\\r)*?-->)"
"todo-tree.regex.regex": "((//|#|;)[ ]*($TAGS)[^\\n]*)|(/\\*(\\*?\\s*)*($TAGS)(.|\\n|\\r)*?\\*/)|(<!--\\s*($TAGS)(.|\\n|\\r)*?-->)"
"todo-tree.regex.regex": "(//|\\*|#|<!--|;|/\\*|^|^[ \\t]*(-|\\d+.))\\s*($TAGS)"
or in the settings GUI:
Todo Tree: Regex: Regex: (?:(?://|#|<!--|;|/\*\*?|\*)\s*($TAGS)|^\s*- \[ \])
Todo Tree: Regex: Regex: ((//|#|;|\*)[ ]*($TAGS)[^\n]*)|(/\*(\*?\s*)*($TAGS)(.|\n|\r)*?\*/)|(<!--\s*($TAGS)(.|\n|\r)*?-->)
Todo Tree: Regex: Regex: ((//|#|;)[ ]*($TAGS)[^\n]*)|(/\*(\*?\s*)*($TAGS)(.|\n|\r)*?\*/)|(<!--\s*($TAGS)(.|\n|\r)*?-->)
Todo Tree: Regex: Regex: (//|\*|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS)
A useful exclude globs list:
"todo-tree.filtering.excludeGlobs": [
"**/vendor/**",
"**/node_modules/**",
"**/dist/**",
"**/bower_components/**",
"**/build/**",
"**/.vscode/**",
"**/.github/**",
"**/_output/**",
"**/*.min.*",
"**/*.map"
]