Skip to content

Commit

Permalink
Basic support for escaped double quotes \"...\"
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Aug 27, 2024
1 parent 16e681f commit dc07359
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
"injectTo": [
"source.json"
]
},
{
"scopeName": "source.shellscript.json.escaped",
"path": "./syntaxes/shellscript.json.escaped.tmLanguage.json",
"injectTo": [
"source.json"
]
}
]
},
Expand Down
38 changes: 38 additions & 0 deletions syntaxes/shellscript.json.escaped.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
"name": "package.json",
"scopeName": "source.shellscript.json.escaped",
"injectionSelector": "L:source.json meta.embedded.shellscript.json.package -string.quoted.double.shell",
"patterns": [
{ "include": "#string" }
],
"repository": {
"string": {
"begin": "\\$?(\\\\\")",
"end": "\\\\\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.shell" },
"1": { "name": "constant.character.escape.json" }
},
"endCaptures": { "0": { "name": "punctuation.definition.string.end.shell constant.character.escape.json" } },
"name": "string.quoted.double.shell",
"patterns": [
{
"match": "\\\\{4}",
"name": "constant.character.escape.shell"
},
{
"match": "\\\\{3}\"",
"name": "constant.character.escape.shell"
},
{
"match": "\\\\{2}[$`]",
"name": "constant.character.escape.shell"
},
{ "include": "source.json#stringcontent" },
{ "include": "source.shell#variable" },
{ "include": "source.shell#interpolation" }
]
}
}
}

0 comments on commit dc07359

Please sign in to comment.