Gruntfuggly / todo-tree

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

Question: Is it possible to change the regex to eat characters between TAG and AFTER? #849

Closed jolsen-mitsu closed 4 weeks ago

jolsen-mitsu commented 4 weeks ago

My code is a team effort and there are some variations in the tagged comment styles. Some are like TODO this thing and others have a colon, like IMPORTANT: that thing

When these are parsed and displayed in the tree, such as ${tag} ${after} the latter style will appear as IMPORTANT : that thing or in my updated tooltip of ${after}, path ${filepath}, line ${line} it will appear as : that thing, path path/to/file, line 123

What I'd like to configure to show for all TODOs (with or without the ": " in between the tag and the rest of the line) in the tree, such as ${tag} ${after} the latter style will appear as IMPORTANT that thing or in my updated tooltip of ${after}, path ${filepath}, line ${line} it will appear as that thing, path path/to/file, line 123

I tried to modify the default regex of (//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS) to a few variations of the following (//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS):? ? (//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS)[: ]* but I couldn't find anything that worked so that the "tag" was just the tag and the "after" did not contain the punctuation/whitespace between the tag and the remainder of the line.

Is there a way to do this? If not, I'd like to ask for support for this to be added. Thanks!

jolsen-mitsu commented 4 weeks ago

The subtag feature does what I was looking for. Closing