In textmate you can define repositroy within a specific rule and it works fine.
I created this grammar file for test
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>qwe</string>
</array>
<key>name</key>
<string>Qwe</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>begin</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.begin.qwe</string>
</dict>
</dict>
<key>end</key>
<string>end</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.end.qwe</string>
</dict>
</dict>
<key>name</key>
<string>meta.begin-end.qwe</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#foo</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>foo</key>
<dict>
<key>match</key>
<string>foo</string>
<key>name</key>
<string>keyword.control.foo.qwe</string>
</dict>
</dict>
</dict>
</array>
<key>scopeName</key>
<string>source.qwe</string>
<key>uuid</key>
<string>06AD8311-7342-4086-843E-BFB83EBC2377</string>
</dict>
</plist>
result in textmate:

result in vscode:

In vscode whole rule stopped working without any error
In textmate you can define repositroy within a specific rule and it works fine.
I created this grammar file for test
result in textmate:


result in vscode:
In vscode whole rule stopped working without any error