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

Single-line Python docstring not detected #701

Closed alexreg closed 1 year ago

alexreg commented 1 year ago

Using a single-line Python docstring like

"""TODO"""

does not get picked up.

On the other hand, the following does get picked up correctly.

"""
TODO
"""
Gruntfuggly commented 1 year ago

What have you set the regex to?

alexreg commented 1 year ago

@Gruntfuggly My only config setting is the following.

    "todo-tree.general.tags": [
        "BUG",
        "HACK",
        "FIXME",
        "TEMP",
        "TODO",
        "XXX",
    ],
Gruntfuggly commented 1 year ago

Ah OK, yes, it matches your second example due to the default regex. You'll need to add something to the regex, e.g. change it from (\*|//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS) to ("""|\*|//|#|<!--|;|/\*|^|^[ \t]*(-|\d+.))\s*($TAGS)

alexreg commented 1 year ago

@Gruntfuggly That does the job, thank you. Incidentally, the \* wasn't there by default — what's that for?

Also, will you be adjusting the default in a future release? No worries if not.

Gruntfuggly commented 1 year ago

Ah, maybe I had tweaked it for C++.

I don't update the default anymore - every time I used to update it, people complained because it broke the default behaviour. It would never be possible to cover all cases anyway, so it's easier to leave it for people to configure for themselves.

alexreg commented 1 year ago

@Gruntfuggly That's fair enough. Thanks!