diff --git a/package.json b/package.json index 63f8f7f..7695a0b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "injectTo": [ "source.cpp" ], - "path": "syntaxes/cpp.embedded.json", + "path": "syntaxes/cpp.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.cpp": "bat", "meta.embedded.block.cpp.cpp": "cpp", @@ -76,7 +76,7 @@ "injectTo": [ "source.go" ], - "path": "syntaxes/go.embedded.json", + "path": "syntaxes/go.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.go": "bat", "meta.embedded.block.cpp.go": "cpp", @@ -116,7 +116,7 @@ "injectTo": [ "source.nix" ], - "path": "syntaxes/nix.embedded.json", + "path": "syntaxes/nix.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.nix": "bat", "meta.embedded.block.cpp.nix": "cpp", @@ -156,7 +156,7 @@ "injectTo": [ "source.python" ], - "path": "syntaxes/python.embedded.json", + "path": "syntaxes/python.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.python": "bat", "meta.embedded.block.cpp.python": "cpp", @@ -197,7 +197,7 @@ "source.yaml", "text.yaml.jinja" ], - "path": "syntaxes/yaml.embedded.json", + "path": "syntaxes/yaml.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.yaml": "bat", "meta.embedded.block.cpp.yaml": "cpp", @@ -237,7 +237,7 @@ "injectTo": [ "source.js" ], - "path": "syntaxes/javascript.embedded.json", + "path": "syntaxes/javascript.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.javascript": "bat", "meta.embedded.block.cpp.javascript": "cpp", @@ -317,7 +317,7 @@ "injectTo": [ "source.powershell" ], - "path": "syntaxes/powershell.embedded.json", + "path": "syntaxes/powershell.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.powershell": "bat", "meta.embedded.block.cpp.powershell": "cpp", @@ -357,7 +357,7 @@ "injectTo": [ "source.ts" ], - "path": "syntaxes/typescript.embedded.json", + "path": "syntaxes/typescript.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.typescript": "bat", "meta.embedded.block.cpp.typescript": "cpp", @@ -437,7 +437,7 @@ "injectTo": [ "source.rust" ], - "path": "syntaxes/rust.embedded.json", + "path": "syntaxes/rust.embedded.tmLanguage.json", "embeddedLanguages": { "meta.embedded.block.bat.rust": "bat", "meta.embedded.block.cpp.rust": "cpp", diff --git a/syntaxes/cpp.embedded.json b/syntaxes/cpp.embedded.tmLanguage.json similarity index 100% rename from syntaxes/cpp.embedded.json rename to syntaxes/cpp.embedded.tmLanguage.json diff --git a/syntaxes/go.embedded.json b/syntaxes/go.embedded.tmLanguage.json old mode 100755 new mode 100644 similarity index 100% rename from syntaxes/go.embedded.json rename to syntaxes/go.embedded.tmLanguage.json diff --git a/syntaxes/javascript.embedded.json b/syntaxes/javascript.embedded.tmLanguage.json old mode 100755 new mode 100644 similarity index 92% rename from syntaxes/javascript.embedded.json rename to syntaxes/javascript.embedded.tmLanguage.json index 741c19d..3497e9b --- a/syntaxes/javascript.embedded.json +++ b/syntaxes/javascript.embedded.tmLanguage.json @@ -1186,12 +1186,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.batchfile" } @@ -1216,12 +1210,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.cpp" } @@ -1246,12 +1234,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.css" } @@ -1276,12 +1258,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "text.html.derivative" } @@ -1306,12 +1282,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.ini" } @@ -1336,12 +1306,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.js" } @@ -1366,12 +1330,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.json" } @@ -1396,12 +1354,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.json.comments" } @@ -1426,12 +1378,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.python" } @@ -1456,12 +1402,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.shell" } @@ -1486,12 +1426,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.sql" } @@ -1516,12 +1450,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.toml" } @@ -1546,12 +1474,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "text.xml" } @@ -1576,12 +1498,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.yaml" } @@ -1606,12 +1522,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.c" } @@ -1636,12 +1546,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.hlsl" } @@ -1666,12 +1570,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.glsl" } @@ -1696,12 +1594,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.metal" } @@ -1726,12 +1618,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.wgsl" } @@ -1756,12 +1642,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.lua" } @@ -1786,12 +1666,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.makefile" } @@ -1816,12 +1690,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.graphql" } @@ -1846,12 +1714,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.ts" } @@ -1876,12 +1738,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "text.tex.latex" } @@ -1906,12 +1762,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "text.tex" } @@ -1936,12 +1786,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.dot" } @@ -1966,12 +1810,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.arm" } @@ -1996,12 +1834,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.asm.x86_64" } @@ -2026,12 +1858,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "text.html.handlebars" } @@ -2056,12 +1882,6 @@ } }, "patterns": [ - { - "include": "#template-substitution-element" - }, - { - "include": "#string-character-escape" - }, { "include": "source.powershell" } diff --git a/syntaxes/nix.embedded.json b/syntaxes/nix.embedded.tmLanguage.json similarity index 100% rename from syntaxes/nix.embedded.json rename to syntaxes/nix.embedded.tmLanguage.json diff --git a/syntaxes/powershell.embedded.json b/syntaxes/powershell.embedded.tmLanguage.json similarity index 100% rename from syntaxes/powershell.embedded.json rename to syntaxes/powershell.embedded.tmLanguage.json diff --git a/syntaxes/python.embedded.json b/syntaxes/python.embedded.tmLanguage.json similarity index 100% rename from syntaxes/python.embedded.json rename to syntaxes/python.embedded.tmLanguage.json diff --git a/syntaxes/rust.embedded.json b/syntaxes/rust.embedded.tmLanguage.json similarity index 100% rename from syntaxes/rust.embedded.json rename to syntaxes/rust.embedded.tmLanguage.json diff --git a/syntaxes/typescript.embedded.json b/syntaxes/typescript.embedded.tmLanguage.json similarity index 100% rename from syntaxes/typescript.embedded.json rename to syntaxes/typescript.embedded.tmLanguage.json diff --git a/syntaxes/yaml.embedded.json b/syntaxes/yaml.embedded.tmLanguage.json similarity index 100% rename from syntaxes/yaml.embedded.json rename to syntaxes/yaml.embedded.tmLanguage.json diff --git a/utilities/syntax_assembler.js b/utilities/syntax_assembler.js index cabfc61..663935c 100755 --- a/utilities/syntax_assembler.js +++ b/utilities/syntax_assembler.js @@ -39,7 +39,7 @@ const SYNTAX_DIR = 'syntaxes'; */ const HOST_LANGUAGE_SPECS = [ { - file: 'cpp.embedded.json', + file: 'cpp.embedded.tmLanguage.json', root_scopes: ['source.cpp'], syntax_builder: buildCppSyntax, vsname: 'cpp', @@ -48,7 +48,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: ')"', }, { - file: 'go.embedded.json', + file: 'go.embedded.tmLanguage.json', root_scopes: ['source.go'], syntax_builder: buildGoSyntax, vsname: 'go', @@ -57,7 +57,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '`', }, { - file: 'nix.embedded.json', + file: 'nix.embedded.tmLanguage.json', root_scopes: ['source.nix'], syntax_builder: buildNixSyntax, vsname: 'nix', @@ -66,7 +66,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '`', }, { - file: 'python.embedded.json', + file: 'python.embedded.tmLanguage.json', root_scopes: ['source.python'], syntax_builder: buildPythonSyntax, vsname: 'python', @@ -75,7 +75,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '"""', }, { - file: 'yaml.embedded.json', + file: 'yaml.embedded.tmLanguage.json', root_scopes: ['source.yaml', 'text.yaml.jinja'], syntax_builder: buildYamlSyntax, vsname: 'yaml', @@ -84,7 +84,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '', }, { - file: 'javascript.embedded.json', + file: 'javascript.embedded.tmLanguage.json', root_scopes: ['source.js'], syntax_builder: buildTypescriptFamilySyntax, vsname: 'javascript', @@ -102,7 +102,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '`', }, { - file: 'powershell.embedded.json', + file: 'powershell.embedded.tmLanguage.json', root_scopes: ['source.powershell'], syntax_builder: buildPowerShellSyntax, vsname: 'powershell', @@ -111,7 +111,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '', }, { - file: 'typescript.embedded.json', + file: 'typescript.embedded.tmLanguage.json', root_scopes: ['source.ts'], syntax_builder: buildTypescriptFamilySyntax, vsname: 'typescript', @@ -129,7 +129,7 @@ const HOST_LANGUAGE_SPECS = [ snippet_end: '`', }, { - file: 'rust.embedded.json', + file: 'rust.embedded.tmLanguage.json', root_scopes: ['source.rust'], syntax_builder: buildRustSyntax, vsname: 'rust', diff --git a/utilities/syntax_templates/typescript_family_syntax.js b/utilities/syntax_templates/typescript_family_syntax.js index ddab025..e265558 100644 --- a/utilities/syntax_templates/typescript_family_syntax.js +++ b/utilities/syntax_templates/typescript_family_syntax.js @@ -82,8 +82,12 @@ export function buildTypescriptFamilySyntax(hostSpec, embeddedSpecs) { '0': { 'name': `string.template.${suffix} punctuation.definition.string.template.end.${suffix}` }, }, 'patterns': [ - { 'include': '#template-substitution-element' }, - { 'include': '#string-character-escape' }, + // TODO: Can we include something here to make javascript + // tempalte substitutions get highlighted in javascript? + // For example the string in ${} should be JS highlighted: + // const py_string = /*py*/ ` + // print("Hello ${(await fetch('http://example.com')).body.json();}") + // `; { 'include': `${lang.root_scope}` }, ], };