Gruntfuggly / todo-tree

Use ripgrep to find TODO tags and display the results in a tree view
Other
1.41k stars 135 forks source link

Tag starting with '\' #667

Closed wduminy closed 1 year ago

wduminy commented 1 year ago

I'd like to add \todo to todo-tree.general.tags. I tried \todo and \\todo but it does not seem to work

Gruntfuggly commented 1 year ago

Have you tried \\\\ - the \ is the escape character in a regex, so it has to be escaped itself. If you're changing the regex using the json settings editor, you need 4 backslashes because the JSON needs to escape them too!

ct2034 commented 1 year ago

I am having the same issue and \\\\ did not work for me either.

ct2034 commented 1 year ago

But @wduminy , if you are trying to do what I was trying to do, working with latex, then this would be enough: https://github.com/Gruntfuggly/todo-tree/wiki/Configuration-Examples#latex it worked for me.

wduminy commented 1 year ago

@ct2034 Thank you!

After adding these config items the match \todo works.

"todo-tree.regex.regex": "((//|#|<!--|;|/\\*|^|%|\\\\)\\s*($TAGS)\\{*|^\\s*- \\[ \\])",
"todo-tree.regex.regexCaseSensitive": false,

@Gruntfuggly Thanks for a great extension. I am closing this issue.