Skip to content

Commit dc07359

Browse files
committed
Basic support for escaped double quotes \"...\"
1 parent 16e681f commit dc07359

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
"injectTo": [
3636
"source.json"
3737
]
38+
},
39+
{
40+
"scopeName": "source.shellscript.json.escaped",
41+
"path": "./syntaxes/shellscript.json.escaped.tmLanguage.json",
42+
"injectTo": [
43+
"source.json"
44+
]
3845
}
3946
]
4047
},
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
3+
"name": "package.json",
4+
"scopeName": "source.shellscript.json.escaped",
5+
"injectionSelector": "L:source.json meta.embedded.shellscript.json.package -string.quoted.double.shell",
6+
"patterns": [
7+
{ "include": "#string" }
8+
],
9+
"repository": {
10+
"string": {
11+
"begin": "\\$?(\\\\\")",
12+
"end": "\\\\\"",
13+
"beginCaptures": {
14+
"0": { "name": "punctuation.definition.string.begin.shell" },
15+
"1": { "name": "constant.character.escape.json" }
16+
},
17+
"endCaptures": { "0": { "name": "punctuation.definition.string.end.shell constant.character.escape.json" } },
18+
"name": "string.quoted.double.shell",
19+
"patterns": [
20+
{
21+
"match": "\\\\{4}",
22+
"name": "constant.character.escape.shell"
23+
},
24+
{
25+
"match": "\\\\{3}\"",
26+
"name": "constant.character.escape.shell"
27+
},
28+
{
29+
"match": "\\\\{2}[$`]",
30+
"name": "constant.character.escape.shell"
31+
},
32+
{ "include": "source.json#stringcontent" },
33+
{ "include": "source.shell#variable" },
34+
{ "include": "source.shell#interpolation" }
35+
]
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)