Matching labels in a Visual Studio Code grammar

26 views Asked by At

I have this pattern in my language.json repository.

"labels": {
        "patterns": [
            {
                "match": "^(\\w+:)$",
                "captures": {
                    "1": {
                        "name": "labels.control.uat"
                    }
                }
            }
        ]
    }

It is failing to match a label, e.g. TYPEPARAMOK: where that is the only content of a line.

I know that the rest of the grammar is OK since if I change the regex, it matches so I am pretty sure the regex is the problem but in all of my regex testing, it works. Just not here.

0

There are 0 answers