Gruntfuggly / todo-tree

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

The tag after `{` cannot be recognized #742

Closed shaonianruntu closed 1 year ago

shaonianruntu commented 1 year ago

My todo-tree configuration is as follows:

"todo-tree.general.tags": [
    "// TODO"
]
"todo-tree.highlights.customHighlight": {
    "// TODO": {
        "type": "text",
        "foreground": "#FF2D00",
        "icon": "pin",
        "gutterIcon": true,
        "iconColour": "#FF2D00",
        "rulerLane": "full"
      },
}

But in the following c++ code, the "// TODO" tag at comment_a cannot be recognized and highlighted by this plug-in, but comment_b can.

if (functoin_a()) {    // TODO comment_a
    // TODO commnet_b
}

Is there something wrong with my settings?

Gruntfuggly commented 1 year ago

You don't need to include "// " in the tags. The regex has a section to detect the "comment" part, e.g "//", "#", etc.

Try setting the tags to "TODO" and also remove the "// " from the customHighlight setting.

shaonianruntu commented 1 year ago

Thank you, you are right. It should be:

"todo-tree.general.tags": [
    "TODO"
]
"todo-tree.highlights.customHighlight": {
    "TODO": {
        "type": "text-and-comment",
        "foreground": "#FF2D00",
        "icon": "pin",
        "gutterIcon": true,
        "iconColour": "#FF2D00",
        "rulerLane": "full"
      },
}