jgclark / vscode-todo-highlight

VSCode Extension to highlight TODOs etc.
MIT License
103 stars 22 forks source link

Regex pattern in the example not working #100

Closed DrJulik closed 45 minutes ago

DrJulik commented 2 hours ago

Hey, love the extension. I'm trying to make this work, but the regex is just not working. I'm using the example from Readme to have something like TODO(author):

{
            "text": "TODO(string):", // with a regex pattern defined, this setting isn't used, but is useful as a name for this section
            "regex": {
                "pattern": "(?<=^|\"|\\s)TODO(\\(\\w+\\))?:" // this allows for TODO: or TODO(Bob): etc.
            },
            "color": "red",
            "border": "1px solid red",
            "borderRadius": "2px", //NOTE: use borderRadius along with `border` or you will see nothing change
            "backgroundColor": "rgba(0,0,0,.2)"
        }

However, with that in settings.json, this is what I'm seeing.

Screenshot 2024-11-15 at 10 06 13 AM

Any help is apreciated!

DrJulik commented 2 hours ago

Actually, none of the regex patterns I've tried worked for me. It only highlights the stuff in the text field. So in the example above, it will highlight TODO(string) properly. It's just ignoring the regex.

DrJulik commented 45 minutes ago

Fixed! Turns our I had both versions of the extension installed and they were messing with each other.