Skip to content

Commit a0859de

Browse files
committed
Improve legacy_tox_ini injection
1 parent c727ca4 commit a0859de

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed
Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
33
"comment": "https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/pyproject.json",
4-
"name": "json.legacy_tox_ini",
4+
"name": "legacy_tox_ini",
55
"scopeName": "source.json.legacy_tox_ini",
6-
"injectionSelector": "L:source.json .meta.embedded.tool. .meta.embedded.tox. .meta.embedded.legacy_tox_ini. meta.structure.dictionary.value.json -(meta.structure.dictionary.json meta.structure.dictionary.json meta.structure.dictionary.json meta.structure.dictionary.json) -meta.structure.array.json -string -comment",
6+
"injectionSelector": "L:source.json .meta.embedded.tool. .meta.embedded.tox. .meta.embedded.legacy_tox_ini. string.quoted.double.json -(meta.structure.dictionary.json meta.structure.dictionary.json meta.structure.dictionary.json meta.structure.dictionary.json) -meta.structure.array.json -meta.embedded.ini.json -comment -source.json.comments",
77
"patterns": [
8+
{
9+
"comment": "https://github.com/microsoft/vscode-textmate/issues/242",
10+
"include": "source.ini#_pre-load_"
11+
},
812
{ "include": "#legacy_tox_ini" }
913
],
1014
"repository": {
1115
"legacy_tox_ini": {
12-
"patterns": [
13-
{
14-
"comment": "VSCode TextMate bug. For some reason, including a grammar from within a capture group doesn't load the include. We have to pre-load the include outside of a capture group. `source.ini`",
15-
"begin": "(*FAIL)",
16-
"end": "|",
17-
"patterns": [ { "include": "source.ini" } ]
18-
},
19-
{
20-
"match": "(\")((?>[^\\\\\"]++|\\\\.)++)(\")",
21-
"captures": {
22-
"0": { "name": "string.quoted.double.json" },
23-
"1": { "name": "punctuation.definition.string.begin.json" },
24-
"2": {
25-
"name": "meta.embedded.ini.json",
26-
"patterns": [
27-
{ "include": "source.ini" },
28-
{ "include": "source.json#stringcontent" }
29-
]
30-
},
31-
"3": { "name": "punctuation.definition.string.end.json" }
32-
}
16+
"match": "\\G(?>[^\\\\\"\\x-\\x1F]++|\\\\.)++",
17+
"captures": {
18+
"0": {
19+
"name": "meta.embedded.ini.json",
20+
"patterns": [
21+
{ "include": "source.ini" },
22+
{ "include": "source.json#stringcontent" }
23+
]
3324
}
34-
]
25+
}
3526
}
3627
}
3728
}

0 commit comments

Comments
 (0)