Gruntfuggly / todo-tree

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

Support placeholders in custom highlights #640

Open gmccullo opened 2 years ago

gmccullo commented 2 years ago

I wish I could specify highlight colors using ${subTag}. I use subtags arbitrarily, so I don't want to have to define them in settings. I want something like this to work:

{
    "settings": {
        "todo-tree.regex.subTagRegex": "#(.+?\\b)",
        "todo-tree.highlights.defaultHighlight": {
            "type": "tag-and-subTag",
        },
        "todo-tree.highlights.customHighlight": {
            "${subTag}": {
                "background": "#999",
            },
        },
    }
}

So "#important" will be highlighted:

todo: thing to do #important