I'm making the TextMate grammar for a language to get syntax highlighting. This is the rule for @link tags in doc comments:
"scopeName": "source.amx.pawn",
"patterns": [
{
"name": "comment.block.documentation.amx.pawn",
"begin": "/\\*\\*(?!/)",
"end": "\\*/",
"patterns": [{ "include": "#docblock" }]
},
// more patterns...
],
"repository": {
"docblock": {
"patterns": [
"match": "({)(@)(link|linkcode|linkplain)\\s+(\\w+)\\s+(.*)(})",
"captures": {
"1": { "name": "punctuation.definition.bracket.amx.pawn" },
"2": { "name": "punctuation.docblock.at.amx.pawn" },
"3": { "name": "storage.type.class.docblock.tag.amx.pawn" },
"4": { "name": "variable.other.docblock.link.amx.pawn" },
"5": { "name": "entity.name.type.instance.docblock.amx.pawn" },
"6": { "name": "punctuation.definition.bracket.amx.pawn" },
}
]
},
// more stuff...
}
}
Everything is colorized correctly, except for the curly braces. They have the punctuation color (which is what I specified in the rule).
but I assumed vscode would apply the bracket pair colorizer on top of that anyway, like it does on typescript, for example.
As you can see, in typescript it has the bracket pair colorization applied.
If I inspect the editor tokens and scopes, these are the textmate scopes for the curly braces with my grammar:
punctuation.definition.bracket.amx.pawn
comment.block.documentation.amx.pawn
source.amx.pawn
and these are the scopes of the curly braces in typescript:
punctuation.definition.bracket.curly.end.jsdoc
entity.name.type.instance.jsdoc
comment.block.documentation.ts
source.ts
The only difference is the entity.name.type.instance scope, but I think thats a trailing scope from the previous token, so I'm guessing the bracket pair colorizer doesn't care about those scopes.
How can I achieve the same result as with the typescript grammar?


I was experiencing the same issue and solved it by defining a language configuration that included a definition for brackets.