From 26225eb8edb563133d817e3c1ff7f5d9d412e37a Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Fri, 4 Sep 2026 08:39:46 +0200 Subject: [PATCH] feat(syntax): add escaped-quoted-strings token to def syntax Introduces an escaped-quoted-strings pattern for the def syntax. It enables proper highlighting of strings with escapes and vars. The change adds the new pattern to the syntax and fixes the EOF newline. - Adds escaped-quoted-strings for escapes and embedded vars - Registers new pattern in repository for proper highlighting - Ensures trailing newline in the file --- syntaxes/def.tmLanguage.json | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/syntaxes/def.tmLanguage.json b/syntaxes/def.tmLanguage.json index 4a9e9aa..b839512 100644 --- a/syntaxes/def.tmLanguage.json +++ b/syntaxes/def.tmLanguage.json @@ -5,6 +5,9 @@ { "include": "#comment" }, + { + "include": "#escaped-quoted-strings" + }, { "include": "#strings" }, @@ -28,6 +31,31 @@ } ], "repository": { + "escaped-quoted-strings": { + "name": "string.quoted.double.def", + "begin": "\\\\\"", + "end": "\\\\\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.def" + } + }, + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.def" + } + }, + "patterns": [ + { + "name": "constant.character.escape.def", + "match": "\\\\." + }, + { + "name": "variable.other.property", + "match": "\\$[_a-zA-Z][_a-zA-Z0-9]*(\\(\\$?[_a-zA-Z][_a-zA-Z0-9]*(,\\$?[_a-zA-Z][_a-zA-Z0-9]*)*\\))?" + } + ] + }, "keywords": { "patterns": [ { @@ -151,4 +179,4 @@ } }, "scopeName": "source.def" -} \ No newline at end of file +} -- 2.54.0