diff --git a/packages/vscode/languages/handlebars.configuration.json b/packages/vscode/languages/handlebars.configuration.json deleted file mode 100644 index 5db8f2375..000000000 --- a/packages/vscode/languages/handlebars.configuration.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "comments": { - "lineComment": ["{{!", "}}"], - "blockComment": ["{{!--", "--}}"] - }, - "brackets": [ - ["{{", "}}"], - ["(", ")"], - ["<", ">"] - ], - "autoClosingPairs": [ - ["{{", "}}"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - "surroundingPairs": [ - ["{{", "}}"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - "wordPattern": "(-?@?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\|\\;\\'\\.\"\\,\\<\\>/\\?\\s]+)", - "folding": { - "markers": { - "start": "^{{#[^}]*}}", - "end": "^{{\\/[^}]*}}" - } - } -} diff --git a/packages/vscode/languages/inline-template.configuration.json b/packages/vscode/languages/inline-template.configuration.json deleted file mode 100644 index f6d23ff25..000000000 --- a/packages/vscode/languages/inline-template.configuration.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'" }, - { "open": "\"", "close": "\"" }, - { "open": "", "notIn": ["comment", "string"] }, - { "open": "" } - ] -} diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 8ad172ecb..00b3b6585 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -55,12 +55,7 @@ ], "extensions": [ ".gjs" - ], - "configuration": "./languages/inline-template.configuration.json", - "icon": { - "light": "./assets/glimmer-js-light.svg", - "dark": "./assets/glimmer-js-dark.svg" - } + ] }, { "id": "glimmer-ts", @@ -70,95 +65,7 @@ ], "extensions": [ ".gts" - ], - "configuration": "./languages/inline-template.configuration.json", - "icon": { - "light": "./assets/glimmer-ts-light.svg", - "dark": "./assets/glimmer-ts-dark.svg" - } - }, - { - "id": "handlebars", - "extensions": [ - ".hbs" - ], - "aliases": [ - "handlebars", - "hbs" - ], - "configuration": "./languages/handlebars.configuration.json" - }, - { - "id": "markdown-glimmer" - } - ], - "grammars": [ - { - "language": "glimmer-js", - "path": "./syntaxes/source.gjs.json", - "scopeName": "source.gjs", - "embeddedLanguages": { - "source.gjs": "javascript", - "meta.embedded.block.html": "handlebars", - "meta.js.embeddedTemplateWithoutArgs": "handlebars", - "meta.js.embeddedTemplateWithArgs": "handlebars" - }, - "unbalancedBracketScopes": [ - "keyword.operator.relational", - "storage.type.function.arrow", - "keyword.operator.bitwise.shift", - "meta.brace.angle", - "punctuation.definition.tag", - "keyword.operator.assignment.compound.bitwise.ts" - ] - }, - { - "language": "glimmer-ts", - "path": "./syntaxes/source.gts.json", - "scopeName": "source.gts", - "embeddedLanguages": { - "source.gts": "typescript", - "meta.embedded.block.html": "handlebars", - "meta.js.embeddedTemplateWithoutArgs": "handlebars", - "meta.js.embeddedTemplateWithArgs": "handlebars" - }, - "unbalancedBracketScopes": [ - "keyword.operator.relational", - "storage.type.function.arrow", - "keyword.operator.bitwise.shift", - "meta.brace.angle", - "punctuation.definition.tag", - "keyword.operator.assignment.compound.bitwise.ts" ] - }, - { - "label": "Handlebars (Ember)", - "language": "handlebars", - "scopeName": "text.html.ember-handlebars", - "path": "./syntaxes/text.html.ember-handlebars.json" - }, - { - "injectTo": [ - "source.js", - "source.ts" - ], - "scopeName": "inline.hbs", - "path": "./syntaxes/inline.hbs.json", - "embeddedLanguages": { - "meta.embedded.block.html": "handlebars" - } - }, - { - "language": "markdown-glimmer", - "scopeName": "markdown.glimmer.codeblock", - "path": "./syntaxes/markdown.glimmer.codeblock.json", - "injectTo": [ - "text.html.markdown" - ], - "embeddedLanguages": { - "meta.embedded.block.gjs": "glimmer-js", - "meta.embedded.block.gts": "glimmer-ts" - } } ], "typescriptServerPlugins": [ diff --git a/packages/vscode/syntaxes/README.md b/packages/vscode/syntaxes/README.md deleted file mode 100644 index 24c5dd9ca..000000000 --- a/packages/vscode/syntaxes/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Warning! - -This directory contains the compiled grammars. If you need to make modifications please edit the files found in `syntaxes/src/` and then run `pnpm run build:grammars` to compile them. diff --git a/packages/vscode/syntaxes/inline.hbs.json b/packages/vscode/syntaxes/inline.hbs.json deleted file mode 100644 index bf2f2ed81..000000000 --- a/packages/vscode/syntaxes/inline.hbs.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "fileTypes": ["js", "ts"], - "injectionSelector": "L:source.js -comment -(string -meta.embedded), L:source.ts -comment -(string -meta.embedded)", - "injections": { - "L:source": { - "patterns": [ - { - "match": "<", - "name": "invalid.illegal.bad-angle-bracket.html" - } - ] - } - }, - "patterns": [ - { - "contentName": "meta.embedded.block.html", - "begin": "(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)", - "beginCaptures": { - "1": { - "name": "entity.name.function.tagged-template.js" - }, - "2": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`)", - "endCaptures": { - "0": { - "name": "string.js" - }, - "1": { - "name": "punctuation.definition.string.template.end.js" - } - }, - "patterns": [ - { - "include": "source.ts#template-substitution-element" - }, - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "begin": "((createTemplate|hbs|html))(\\()", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - } - ] - }, - { - "begin": "((precompileTemplate)\\s*)(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "include": "source.ts#object-literal" - }, - { - "include": "source.ts" - } - ] - } - ], - "scopeName": "inline.hbs" -} diff --git a/packages/vscode/syntaxes/inline.template.json b/packages/vscode/syntaxes/inline.template.json deleted file mode 100644 index 0b71fc147..000000000 --- a/packages/vscode/syntaxes/inline.template.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "fileTypes": ["gjs", "gts"], - "injectionSelector": "L:source.gjs -comment -(string -meta.embedded), L:source.gts -comment -(string -meta.embedded)", - "patterns": [ - { - "name": "meta.js.embeddedTemplateWithoutArgs", - "begin": "\\s*(<)(template)\\s*(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "name": "meta.js.embeddedTemplateWithArgs", - "begin": "(<)(template)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "begin": "(?<=\\)", - "patterns": [ - { - "include": "text.html.ember-handlebars#tag-like-content" - } - ] - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.js" - } - }, - "end": "(?=)", - "contentName": "meta.html.embedded.block", - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - } - ] - } - ], - "scopeName": "inline.template" -} diff --git a/packages/vscode/syntaxes/markdown.glimmer.codeblock.json b/packages/vscode/syntaxes/markdown.glimmer.codeblock.json deleted file mode 100644 index 053613445..000000000 --- a/packages/vscode/syntaxes/markdown.glimmer.codeblock.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "fileTypes": [], - "injectionSelector": "L:text.html.markdown", - "patterns": [ - { - "include": "#gts-code-block" - }, - { - "include": "#gjs-code-block" - }, - { - "name": "meta.js.embeddedTemplateWithoutArgs", - "begin": "\\s*(<)(template)\\s*(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "name": "meta.js.embeddedTemplateWithArgs", - "begin": "(<)(template)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "begin": "(?<=\\)", - "patterns": [ - { - "include": "text.html.ember-handlebars#tag-like-content" - } - ] - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.js" - } - }, - "end": "(?=)", - "contentName": "meta.html.embedded.block", - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - } - ] - }, - { - "contentName": "meta.embedded.block.html", - "begin": "(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)", - "beginCaptures": { - "1": { - "name": "entity.name.function.tagged-template.js" - }, - "2": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`)", - "endCaptures": { - "0": { - "name": "string.js" - }, - "1": { - "name": "punctuation.definition.string.template.end.js" - } - }, - "patterns": [ - { - "include": "source.ts#template-substitution-element" - }, - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "begin": "((createTemplate|hbs|html))(\\()", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - } - ] - }, - { - "begin": "((precompileTemplate)\\s*)(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "text.html.ember-handlebars" - } - ] - }, - { - "include": "source.ts#object-literal" - }, - { - "include": "source.ts" - } - ] - } - ], - "repository": { - "gts-code-block": { - "name": "markup.fenced_code.block.markdown", - "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(gts)(\\s+[^`~]*)?$)", - "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", - "beginCaptures": { - "3": { - "name": "punctuation.definition.markdown" - }, - "4": { - "name": "fenced_code.block.language.markdown" - }, - "5": { - "name": "fenced_code.block.language.attributes.markdown" - } - }, - "endCaptures": { - "3": { - "name": "punctuation.definition.markdown" - } - }, - "patterns": [ - { - "begin": "(^|\\G)(\\s*)(.*)", - "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.gts", - "patterns": [ - { - "include": "source.gts" - } - ] - } - ] - }, - "gjs-code-block": { - "name": "markup.fenced_code.block.markdown", - "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(gjs)(\\s+[^`~]*)?$)", - "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", - "beginCaptures": { - "3": { - "name": "punctuation.definition.markdown" - }, - "4": { - "name": "fenced_code.block.language.markdown" - }, - "5": { - "name": "fenced_code.block.language.attributes.markdown" - } - }, - "endCaptures": { - "3": { - "name": "punctuation.definition.markdown" - } - }, - "patterns": [ - { - "begin": "(^|\\G)(\\s*)(.*)", - "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.gjs", - "patterns": [ - { - "include": "source.gjs" - } - ] - } - ] - } - }, - "scopeName": "markdown.glimmer.codeblock" -} diff --git a/packages/vscode/syntaxes/source.gjs.json b/packages/vscode/syntaxes/source.gjs.json deleted file mode 100644 index ab88bed24..000000000 --- a/packages/vscode/syntaxes/source.gjs.json +++ /dev/null @@ -1,1492 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "Glimmer JS", - "scopeName": "source.gjs", - "patterns": [ - { - "include": "source.js" - }, - { - "include": "#main" - } - ], - "injections": { - "L:source.gjs -comment -(string -meta.embedded)": { - "patterns": [ - { - "include": "#main" - } - ] - } - }, - "repository": { - "main": { - "patterns": [ - { - "name": "meta.js.embeddedTemplateWithoutArgs", - "begin": "\\s*(<)(template)\\s*(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "meta.js.embeddedTemplateWithArgs", - "begin": "(<)(template)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "begin": "(?<=\\)", - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.js" - } - }, - "end": "(?=)", - "contentName": "meta.html.embedded.block", - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - } - ] - }, - { - "contentName": "meta.embedded.block.html", - "begin": "(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)", - "beginCaptures": { - "1": { - "name": "entity.name.function.tagged-template.js" - }, - "2": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`)", - "endCaptures": { - "0": { - "name": "string.js" - }, - "1": { - "name": "punctuation.definition.string.template.end.js" - } - }, - "patterns": [ - { - "include": "source.ts#template-substitution-element" - }, - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "begin": "((createTemplate|hbs|html))(\\()", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - } - ] - }, - { - "begin": "((precompileTemplate)\\s*)(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "include": "source.ts#object-literal" - }, - { - "include": "source.ts" - } - ] - } - ] - }, - "glimmer-component-path": { - "match": "(::|_|\\$|\\.)", - "captures": { - "1": { - "name": "punctuation.definition.tag" - } - } - }, - "string-double-quoted-handlebars": { - "name": "string.quoted.double.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - } - ] - }, - "string-single-quoted-handlebars": { - "name": "string.quoted.single.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - } - ] - }, - "string-double-quoted-html": { - "name": "string.quoted.double.html.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "string-single-quoted-html": { - "name": "string.quoted.single.html.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "boolean": { - "match": "true|false|undefined|null", - "captures": { - "0": { - "name": "string.regexp" - }, - "1": { - "name": "string.regexp" - }, - "2": { - "name": "string.regexp" - } - }, - "patterns": [] - }, - "digit": { - "match": "\\d*(\\.)?\\d+", - "captures": { - "0": { - "name": "constant.numeric" - }, - "1": { - "name": "constant.numeric" - }, - "2": { - "name": "constant.numeric" - } - }, - "patterns": [] - }, - "param": { - "match": "(@|this.)([a-zA-Z0-9_.-]+)", - "captures": { - "0": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "1": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [] - }, - "attention": { - "name": "storage.type.class.${1:/downcase}", - "match": "@?(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|TEMP)\\b", - "patterns": [] - }, - "glimmer-unescaped-expression": { - "name": "entity.unescaped.expression.ember-handlebars", - "begin": "{{{", - "end": "}}}", - "captures": { - "0": { - "name": "keyword.operator" - } - }, - "patterns": [ - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#glimmer-subexp" - }, - { - "include": "#param" - } - ] - }, - "glimmer-comment-block": { - "name": "comment.block.glimmer", - "begin": "{{!--", - "end": "--}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-comment-inline": { - "name": "comment.inline.glimmer", - "begin": "{{!", - "end": "}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-bools": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(true|false|null|undefined|\\d*(\\.)?\\d+)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "string.regexp" - }, - "3": { - "name": "string.regexp" - }, - "4": { - "name": "keyword.operator" - } - } - }, - "glimmer-else-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(else\\s[a-z]+\\s|else)([()@a-zA-Z0-9\\.\\s\\b]+)?(~?}})", - "captures": { - "0": { - "name": "punctuation.definition.tag" - }, - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "4": { - "name": "punctuation.definition.tag" - } - } - }, - "glimmer-special-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(yield|outlet)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.operator" - } - } - }, - "glimmer-as-stuff": { - "patterns": [ - { - "include": "#as-keyword" - }, - { - "include": "#as-params" - } - ] - }, - "glimmer-block": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(#|/)(([@\\$a-zA-Z0-9_/.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\/)+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression-property": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)((@|this.)([a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "4": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([()\\s@a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "string.regexp", - "match": "[(]+" - }, - { - "name": "string.regexp", - "match": "[)]+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - }, - { - "include": "#glimmer-supexp-content" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-supexp-content": { - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "glimmer-control-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([-a-zA-Z_0-9/]+)\\s)", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-subexp": { - "name": "entity.subexpression.ember-handlebars", - "begin": "(\\()([@a-zA-Z0-9.-]+)", - "end": "(\\))", - "captures": { - "1": { - "name": "keyword.other" - }, - "2": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "as-keyword": { - "name": "keyword.control", - "match": "\\s\\b(as)\\b(?=\\s\\|)", - "patterns": [] - }, - "as-params": { - "name": "keyword.block-params.ember-handlebars", - "begin": "(?)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.style.start.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(?i)((<)/)(style)\\s*(>)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.style.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.css-ignored-vscode" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "captures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(>)", - "name": "meta.tag.metadata.style.start.html", - "patterns": [ - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - { - "begin": "(?!\\G)", - "end": "(?=)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "end": "(?=/)", - "patterns": [ - { - "begin": "(>)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.script.start.html" - }, - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.js-ignored-vscode" - } - }, - "patterns": [ - { - "begin": "\\G", - "end": "(?=]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)", - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "text.html.basic" - } - }, - "patterns": [ - { - "begin": "(?!\\G)", - "end": "(?=", - "captures": { - "0": { - "name": "punctuation.definition.comment.html.ember-handlebars" - } - }, - "patterns": [ - { - "include": "#attention" - }, - { - "match": "--", - "name": "invalid.illegal.bad-comments-or-CDATA.html.ember-handlebars" - } - ] - }, - "tag-like-content": { - "patterns": [ - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#string-double-quoted-html" - }, - { - "include": "#string-single-quoted-html" - }, - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - "component-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)(@|this.)?([a-zA-Z0-9-_\\$:\\.]+)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "3": { - "name": "entity.name.type", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "markup.bold", - "match": "(@|:|\\$)" - } - ] - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "html-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)([a-z0-9-]+)(?!\\.|:)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "entity.name.tag.html.ember-handlebars" - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "glimmer-argument": { - "match": "\\s(@[a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars.argument", - "patterns": [ - { - "name": "markup.italic", - "match": "(@)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "html-attribute": { - "match": "\\s([a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars", - "patterns": [ - { - "name": "markup.bold", - "match": "(\\.\\.\\.attributes)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html.ember-handlebars", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html.ember-handlebars" - }, - "3": { - "name": "punctuation.definition.entity.html.ember-handlebars" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html.ember-handlebars", - "match": "&" - } - ] - } - } -} diff --git a/packages/vscode/syntaxes/source.gts.json b/packages/vscode/syntaxes/source.gts.json deleted file mode 100644 index 0bd5382cc..000000000 --- a/packages/vscode/syntaxes/source.gts.json +++ /dev/null @@ -1,1492 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "Glimmer TS", - "scopeName": "source.gts", - "patterns": [ - { - "include": "source.ts" - }, - { - "include": "#main" - } - ], - "injections": { - "L:source.gts -comment -(string -meta.embedded)": { - "patterns": [ - { - "include": "#main" - } - ] - } - }, - "repository": { - "main": { - "patterns": [ - { - "name": "meta.js.embeddedTemplateWithoutArgs", - "begin": "\\s*(<)(template)\\s*(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "name": "meta.js.embeddedTemplateWithArgs", - "begin": "(<)(template)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - } - }, - "end": "()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.other.html" - }, - "3": { - "name": "punctuation.definition.tag.html" - } - }, - "patterns": [ - { - "begin": "(?<=\\)", - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - { - "begin": "(>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.end.js" - } - }, - "end": "(?=)", - "contentName": "meta.html.embedded.block", - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - } - ] - }, - { - "contentName": "meta.embedded.block.html", - "begin": "(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)", - "beginCaptures": { - "1": { - "name": "entity.name.function.tagged-template.js" - }, - "2": { - "name": "punctuation.definition.string.template.begin.js" - } - }, - "end": "(`)", - "endCaptures": { - "0": { - "name": "string.js" - }, - "1": { - "name": "punctuation.definition.string.template.end.js" - } - }, - "patterns": [ - { - "include": "source.ts#template-substitution-element" - }, - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "begin": "((createTemplate|hbs|html))(\\()", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - } - ] - }, - { - "begin": "((precompileTemplate)\\s*)(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.ts" - }, - "2": { - "name": "meta.function-call.ts" - }, - "3": { - "name": "meta.brace.round.ts" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "meta.brace.round.ts" - } - }, - "patterns": [ - { - "begin": "((`|'|\"))", - "contentName": "meta.embedded.block.html", - "beginCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.begin.ts" - } - }, - "end": "((`|'|\"))", - "endCaptures": { - "1": { - "name": "string.template.ts" - }, - "2": { - "name": "punctuation.definition.string.template.end.ts" - } - }, - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ] - }, - { - "include": "source.ts#object-literal" - }, - { - "include": "source.ts" - } - ] - } - ] - }, - "glimmer-component-path": { - "match": "(::|_|\\$|\\.)", - "captures": { - "1": { - "name": "punctuation.definition.tag" - } - } - }, - "string-double-quoted-handlebars": { - "name": "string.quoted.double.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - } - ] - }, - "string-single-quoted-handlebars": { - "name": "string.quoted.single.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - } - ] - }, - "string-double-quoted-html": { - "name": "string.quoted.double.html.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "string-single-quoted-html": { - "name": "string.quoted.single.html.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "boolean": { - "match": "true|false|undefined|null", - "captures": { - "0": { - "name": "string.regexp" - }, - "1": { - "name": "string.regexp" - }, - "2": { - "name": "string.regexp" - } - }, - "patterns": [] - }, - "digit": { - "match": "\\d*(\\.)?\\d+", - "captures": { - "0": { - "name": "constant.numeric" - }, - "1": { - "name": "constant.numeric" - }, - "2": { - "name": "constant.numeric" - } - }, - "patterns": [] - }, - "param": { - "match": "(@|this.)([a-zA-Z0-9_.-]+)", - "captures": { - "0": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "1": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [] - }, - "attention": { - "name": "storage.type.class.${1:/downcase}", - "match": "@?(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|TEMP)\\b", - "patterns": [] - }, - "glimmer-unescaped-expression": { - "name": "entity.unescaped.expression.ember-handlebars", - "begin": "{{{", - "end": "}}}", - "captures": { - "0": { - "name": "keyword.operator" - } - }, - "patterns": [ - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#glimmer-subexp" - }, - { - "include": "#param" - } - ] - }, - "glimmer-comment-block": { - "name": "comment.block.glimmer", - "begin": "{{!--", - "end": "--}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-comment-inline": { - "name": "comment.inline.glimmer", - "begin": "{{!", - "end": "}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-bools": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(true|false|null|undefined|\\d*(\\.)?\\d+)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "string.regexp" - }, - "3": { - "name": "string.regexp" - }, - "4": { - "name": "keyword.operator" - } - } - }, - "glimmer-else-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(else\\s[a-z]+\\s|else)([()@a-zA-Z0-9\\.\\s\\b]+)?(~?}})", - "captures": { - "0": { - "name": "punctuation.definition.tag" - }, - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "4": { - "name": "punctuation.definition.tag" - } - } - }, - "glimmer-special-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(yield|outlet)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.operator" - } - } - }, - "glimmer-as-stuff": { - "patterns": [ - { - "include": "#as-keyword" - }, - { - "include": "#as-params" - } - ] - }, - "glimmer-block": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(#|/)(([@\\$a-zA-Z0-9_/.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\/)+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression-property": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)((@|this.)([a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "4": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([()\\s@a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "string.regexp", - "match": "[(]+" - }, - { - "name": "string.regexp", - "match": "[)]+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - }, - { - "include": "#glimmer-supexp-content" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-supexp-content": { - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "glimmer-control-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([-a-zA-Z_0-9/]+)\\s)", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-subexp": { - "name": "entity.subexpression.ember-handlebars", - "begin": "(\\()([@a-zA-Z0-9.-]+)", - "end": "(\\))", - "captures": { - "1": { - "name": "keyword.other" - }, - "2": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "as-keyword": { - "name": "keyword.control", - "match": "\\s\\b(as)\\b(?=\\s\\|)", - "patterns": [] - }, - "as-params": { - "name": "keyword.block-params.ember-handlebars", - "begin": "(?)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.style.start.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(?i)((<)/)(style)\\s*(>)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.style.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.css-ignored-vscode" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "captures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(>)", - "name": "meta.tag.metadata.style.start.html", - "patterns": [ - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - { - "begin": "(?!\\G)", - "end": "(?=)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "end": "(?=/)", - "patterns": [ - { - "begin": "(>)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.script.start.html" - }, - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.js-ignored-vscode" - } - }, - "patterns": [ - { - "begin": "\\G", - "end": "(?=]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)", - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "text.html.basic" - } - }, - "patterns": [ - { - "begin": "(?!\\G)", - "end": "(?=", - "captures": { - "0": { - "name": "punctuation.definition.comment.html.ember-handlebars" - } - }, - "patterns": [ - { - "include": "#attention" - }, - { - "match": "--", - "name": "invalid.illegal.bad-comments-or-CDATA.html.ember-handlebars" - } - ] - }, - "tag-like-content": { - "patterns": [ - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#string-double-quoted-html" - }, - { - "include": "#string-single-quoted-html" - }, - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - "component-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)(@|this.)?([a-zA-Z0-9-_\\$:\\.]+)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "3": { - "name": "entity.name.type", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "markup.bold", - "match": "(@|:|\\$)" - } - ] - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "html-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)([a-z0-9-]+)(?!\\.|:)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "entity.name.tag.html.ember-handlebars" - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "glimmer-argument": { - "match": "\\s(@[a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars.argument", - "patterns": [ - { - "name": "markup.italic", - "match": "(@)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "html-attribute": { - "match": "\\s([a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars", - "patterns": [ - { - "name": "markup.bold", - "match": "(\\.\\.\\.attributes)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html.ember-handlebars", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html.ember-handlebars" - }, - "3": { - "name": "punctuation.definition.entity.html.ember-handlebars" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html.ember-handlebars", - "match": "&" - } - ] - } - } -} diff --git a/packages/vscode/syntaxes/src/index.mjs b/packages/vscode/syntaxes/src/index.mjs deleted file mode 100644 index b98465e99..000000000 --- a/packages/vscode/syntaxes/src/index.mjs +++ /dev/null @@ -1,137 +0,0 @@ -import { writeFileSync } from 'node:fs'; -import { fileURLToPath } from 'node:url'; -import { dirname, resolve } from 'node:path'; - -import glimmerJavascript from './source.gjs.mjs'; -import glimmerTypescript from './source.gts.mjs'; -import inlineHandlebars from './inline.hbs.mjs'; -import inlineTemplate from './inline.template.mjs'; -import emberHandlebars from './text.html.ember-handlebars.mjs'; -import markdownGlimmer from './markdown.glimmer.codeblock.mjs'; - -function deepCopy(obj) { - return JSON.parse(JSON.stringify(obj)); -} - -const [inlineTemplateInjectionSelectorGJS, inlineTemplateInjectionSelectorGTS] = - inlineTemplate.injectionSelector.split(', '); - -function mergeGlimmerSourceGrammars(grammar, injectionSelector) { - // copy patterns and repository to avoid mutating the original grammars - const copiedEmberHandlebarPatterns = deepCopy(emberHandlebars.patterns); - const copiedEmberHandlebarRepository = deepCopy(emberHandlebars.repository); - const copiedInlineTemplatePatterns = deepCopy(inlineTemplate.patterns); - const copiedInlineHandlebarsPatterns = deepCopy(inlineHandlebars.patterns); - - grammar.injections = { - [injectionSelector]: { - patterns: [{ include: '#main' }], - }, - }; - - grammar.patterns.push({ include: '#main' }); - - grammar.repository = { - main: { - patterns: [...copiedInlineTemplatePatterns, ...copiedInlineHandlebarsPatterns], - }, - ...copiedEmberHandlebarRepository, - }; - - // Embedded Template With Args - const embeddedTemplateWithArgs = grammar.repository.main.patterns.find( - (pattern) => pattern.name === 'meta.js.embeddedTemplateWithArgs', - ); - embeddedTemplateWithArgs.patterns.find((pattern) => pattern.begin === '(>)').patterns = [ - ...copiedEmberHandlebarPatterns, - ]; - - const tagLikeContent = embeddedTemplateWithArgs.patterns.find( - (pattern) => pattern.begin === '(?<=\\ pattern.name === 'meta.js.embeddedTemplateWithoutArgs', - ); - embeddedTemplateWithoutArgs.patterns = [...copiedEmberHandlebarPatterns]; - - // Tagged template (hbs/html) - const taggedTemplate = grammar.repository.main.patterns.find( - (pattern) => pattern.begin === '(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)', - ); - const filteredPatterns = taggedTemplate.patterns.filter( - (pattern) => pattern.include !== 'text.html.ember-handlebars', - ); - taggedTemplate.patterns = [...filteredPatterns, ...copiedEmberHandlebarPatterns]; - - // createTemplate/hbs/html functions - const createTemplate = grammar.repository.main.patterns - .find((pattern) => pattern.begin === '((createTemplate|hbs|html))(\\()') - .patterns.find((pattern) => pattern.begin === '((`|\'|"))'); - - createTemplate.patterns = [...copiedEmberHandlebarPatterns]; - - // precompileTemplate function - const precompileTemplate = grammar.repository.main.patterns - .find((pattern) => pattern.begin === '((precompileTemplate)\\s*)(\\()') - .patterns.find((pattern) => pattern.begin === '((`|\'|"))'); - - precompileTemplate.patterns = [...copiedEmberHandlebarPatterns]; -} - -mergeGlimmerSourceGrammars(glimmerJavascript, inlineTemplateInjectionSelectorGJS); -mergeGlimmerSourceGrammars(glimmerTypescript, inlineTemplateInjectionSelectorGTS); - -function mergeMarkdownGrammar() { - const copiedInlineTemplatePatterns = deepCopy(inlineTemplate.patterns); - const copiedInlineHandlebarsPatterns = deepCopy(inlineHandlebars.patterns); - - markdownGlimmer.patterns.push(...copiedInlineTemplatePatterns, ...copiedInlineHandlebarsPatterns); -} - -mergeMarkdownGrammar(); - -const grammars = [ - glimmerJavascript, - glimmerTypescript, - inlineHandlebars, - inlineTemplate, - emberHandlebars, - markdownGlimmer, -]; - -const outDirectory = resolve(dirname(fileURLToPath(import.meta.url)), '../'); - -const errors = []; - -console.log('Writing grammars...\n'); - -for (const grammar of grammars) { - const fileName = `${grammar.scopeName}.json`; - const filePath = resolve(outDirectory, fileName); - - try { - writeFileSync(filePath, JSON.stringify(grammar, null, 2)); - console.log(`✅ ${fileName}`); - } catch (error) { - console.error(`❌ ${fileName}`); - errors.push({ file: fileName, error }); - } -} - -if (errors.length) { - console.error(`💀 ${errors.length} grammars failed to write to ${outDirectory}`); - for (const { file, error } of errors) { - console.log(`\n${'-'.repeat(file.length)}\n${file}\n${'-'.repeat(file.length)}`); - console.error(error); - } - process.exitCode = 1; -} else { - console.log(`\n🎉 All grammars written to ${outDirectory}`); -} diff --git a/packages/vscode/syntaxes/src/inline.hbs.mjs b/packages/vscode/syntaxes/src/inline.hbs.mjs deleted file mode 100644 index cc479a3f5..000000000 --- a/packages/vscode/syntaxes/src/inline.hbs.mjs +++ /dev/null @@ -1,149 +0,0 @@ -export default { - fileTypes: ['js', 'ts'], - injectionSelector: - 'L:source.js -comment -(string -meta.embedded), L:source.ts -comment -(string -meta.embedded)', - injections: { - 'L:source': { - patterns: [ - { - match: '<', - name: 'invalid.illegal.bad-angle-bracket.html', - }, - ], - }, - }, - patterns: [ - { - contentName: 'meta.embedded.block.html', - begin: '(?x)(\\b(?:\\w+\\.)*(?:hbs|html)\\s*)(`)', - beginCaptures: { - 1: { - name: 'entity.name.function.tagged-template.js', - }, - 2: { - name: 'punctuation.definition.string.template.begin.js', - }, - }, - end: '(`)', - endCaptures: { - 0: { - name: 'string.js', - }, - 1: { - name: 'punctuation.definition.string.template.end.js', - }, - }, - patterns: [ - { - include: 'source.ts#template-substitution-element', - }, - { - include: 'text.html.ember-handlebars', - }, - ], - }, - { - begin: '((createTemplate|hbs|html))(\\()', - contentName: 'meta.embedded.block.html', - beginCaptures: { - 1: { - name: 'entity.name.function.ts', - }, - 2: { - name: 'meta.function-call.ts', - }, - 3: { - name: 'meta.brace.round.ts', - }, - }, - end: '(\\))', - endCaptures: { - 1: { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - begin: '((`|\'|"))', - beginCaptures: { - 1: { - name: 'string.template.ts', - }, - 2: { - name: 'punctuation.definition.string.template.begin.ts', - }, - }, - end: '((`|\'|"))', - endCaptures: { - 1: { - name: 'string.template.ts', - }, - 2: { - name: 'punctuation.definition.string.template.end.ts', - }, - }, - patterns: [ - { - include: 'text.html.ember-handlebars', - }, - ], - }, - ], - }, - { - begin: '((precompileTemplate)\\s*)(\\()', - beginCaptures: { - 1: { - name: 'entity.name.function.ts', - }, - 2: { - name: 'meta.function-call.ts', - }, - 3: { - name: 'meta.brace.round.ts', - }, - }, - end: '(\\))', - endCaptures: { - 1: { - name: 'meta.brace.round.ts', - }, - }, - patterns: [ - { - begin: '((`|\'|"))', - contentName: 'meta.embedded.block.html', - beginCaptures: { - 1: { - name: 'string.template.ts', - }, - 2: { - name: 'punctuation.definition.string.template.begin.ts', - }, - }, - end: '((`|\'|"))', - endCaptures: { - 1: { - name: 'string.template.ts', - }, - 2: { - name: 'punctuation.definition.string.template.end.ts', - }, - }, - patterns: [ - { - include: 'text.html.ember-handlebars', - }, - ], - }, - { - include: 'source.ts#object-literal', - }, - { - include: 'source.ts', - }, - ], - }, - ], - scopeName: 'inline.hbs', -}; diff --git a/packages/vscode/syntaxes/src/inline.template.mjs b/packages/vscode/syntaxes/src/inline.template.mjs deleted file mode 100644 index 66e71c87d..000000000 --- a/packages/vscode/syntaxes/src/inline.template.mjs +++ /dev/null @@ -1,90 +0,0 @@ -export default { - fileTypes: ['gjs', 'gts'], - injectionSelector: - 'L:source.gjs -comment -(string -meta.embedded), L:source.gts -comment -(string -meta.embedded)', - patterns: [ - { - name: 'meta.js.embeddedTemplateWithoutArgs', - begin: '\\s*(<)(template)\\s*(>)', - beginCaptures: { - 1: { - name: 'punctuation.definition.tag.html', - }, - 2: { - name: 'entity.name.tag.other.html', - }, - 3: { - name: 'punctuation.definition.tag.html', - }, - }, - end: '()', - endCaptures: { - 1: { - name: 'punctuation.definition.tag.html', - }, - 2: { - name: 'entity.name.tag.other.html', - }, - 3: { - name: 'punctuation.definition.tag.html', - }, - }, - patterns: [ - { - include: 'text.html.ember-handlebars', - }, - ], - }, - { - name: 'meta.js.embeddedTemplateWithArgs', - begin: '(<)(template)', - beginCaptures: { - 1: { - name: 'punctuation.definition.tag.html', - }, - 2: { - name: 'entity.name.tag.other.html', - }, - }, - end: '()', - endCaptures: { - 1: { - name: 'punctuation.definition.tag.html', - }, - 2: { - name: 'entity.name.tag.other.html', - }, - 3: { - name: 'punctuation.definition.tag.html', - }, - }, - patterns: [ - { - begin: '(?<=\\)', - patterns: [ - { - include: 'text.html.ember-handlebars#tag-like-content', - }, - ], - }, - { - begin: '(>)', - beginCaptures: { - 1: { - name: 'punctuation.definition.tag.end.js', - }, - }, - end: '(?=)', - contentName: 'meta.html.embedded.block', - patterns: [ - { - include: 'text.html.ember-handlebars', - }, - ], - }, - ], - }, - ], - scopeName: 'inline.template', -}; diff --git a/packages/vscode/syntaxes/src/markdown.glimmer.codeblock.mjs b/packages/vscode/syntaxes/src/markdown.glimmer.codeblock.mjs deleted file mode 100644 index ff677283c..000000000 --- a/packages/vscode/syntaxes/src/markdown.glimmer.codeblock.mjs +++ /dev/null @@ -1,94 +0,0 @@ -function regexes(extension) { - return { - fencedCodeBlock: { - begin: `(^|\\G)(\\s*)(\\\`{3,}|~{3,})\\s*(?i:(${extension})(\\s+[^\`~]*)?$)`, - end: '(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$', - }, - embeddedBlock: { - begin: '(^|\\G)(\\s*)(.*)', - while: '(^|\\G)(?!\\s*([`~]{3,})\\s*$)', - }, - }; -} - -export default { - fileTypes: [], - injectionSelector: 'L:text.html.markdown', - patterns: [ - { - include: '#gts-code-block', - }, - { - include: '#gjs-code-block', - }, - ], - repository: { - 'gts-code-block': { - name: 'markup.fenced_code.block.markdown', - begin: regexes('gts').fencedCodeBlock.begin, - end: regexes('gts').fencedCodeBlock.end, - beginCaptures: { - 3: { - name: 'punctuation.definition.markdown', - }, - 4: { - name: 'fenced_code.block.language.markdown', - }, - 5: { - name: 'fenced_code.block.language.attributes.markdown', - }, - }, - endCaptures: { - 3: { - name: 'punctuation.definition.markdown', - }, - }, - patterns: [ - { - begin: regexes('gts').embeddedBlock.begin, - while: regexes('gts').embeddedBlock.while, - contentName: 'meta.embedded.block.gts', - patterns: [ - { - include: 'source.gts', - }, - ], - }, - ], - }, - 'gjs-code-block': { - name: 'markup.fenced_code.block.markdown', - begin: regexes('gjs').fencedCodeBlock.begin, - end: regexes('gjs').fencedCodeBlock.end, - beginCaptures: { - 3: { - name: 'punctuation.definition.markdown', - }, - 4: { - name: 'fenced_code.block.language.markdown', - }, - 5: { - name: 'fenced_code.block.language.attributes.markdown', - }, - }, - endCaptures: { - 3: { - name: 'punctuation.definition.markdown', - }, - }, - patterns: [ - { - begin: regexes('gjs').embeddedBlock.begin, - while: regexes('gjs').embeddedBlock.while, - contentName: 'meta.embedded.block.gjs', - patterns: [ - { - include: 'source.gjs', - }, - ], - }, - ], - }, - }, - scopeName: 'markdown.glimmer.codeblock', -}; diff --git a/packages/vscode/syntaxes/src/source.gjs.mjs b/packages/vscode/syntaxes/src/source.gjs.mjs deleted file mode 100644 index fd9e2386b..000000000 --- a/packages/vscode/syntaxes/src/source.gjs.mjs +++ /dev/null @@ -1,6 +0,0 @@ -export default { - $schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json', - name: 'Glimmer JS', - scopeName: 'source.gjs', - patterns: [{ include: 'source.js' }], -}; diff --git a/packages/vscode/syntaxes/src/source.gts.mjs b/packages/vscode/syntaxes/src/source.gts.mjs deleted file mode 100644 index eaf02ed4a..000000000 --- a/packages/vscode/syntaxes/src/source.gts.mjs +++ /dev/null @@ -1,6 +0,0 @@ -export default { - $schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json', - name: 'Glimmer TS', - scopeName: 'source.gts', - patterns: [{ include: 'source.ts' }], -}; diff --git a/packages/vscode/syntaxes/src/text.html.ember-handlebars.mjs b/packages/vscode/syntaxes/src/text.html.ember-handlebars.mjs deleted file mode 100644 index f8c5fe111..000000000 --- a/packages/vscode/syntaxes/src/text.html.ember-handlebars.mjs +++ /dev/null @@ -1,1085 +0,0 @@ -export default { - $schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json', - name: 'Glimmer', - scopeName: 'text.html.ember-handlebars', - fileTypes: ['hbs'], - patterns: [ - { - include: '#style', - }, - { - include: '#script', - }, - { - include: '#glimmer-else-block', - }, - { - include: '#glimmer-bools', - }, - { - include: '#glimmer-special-block', - }, - { - include: '#glimmer-unescaped-expression', - }, - { - include: '#glimmer-comment-block', - }, - { - include: '#glimmer-comment-inline', - }, - { - include: '#glimmer-expression-property', - }, - { - include: '#glimmer-control-expression', - }, - { - include: '#glimmer-expression', - }, - { - include: '#glimmer-block', - }, - { - include: '#html-tag', - }, - { - include: '#component-tag', - }, - { - include: '#html-comment', - }, - { - include: '#entities', - }, - ], - repository: { - 'glimmer-component-path': { - match: '(::|_|\\$|\\.)', - captures: { - 1: { - name: 'punctuation.definition.tag', - }, - }, - }, - 'string-double-quoted-handlebars': { - name: 'string.quoted.double.ember-handlebars', - begin: '"', - beginCaptures: { - 0: { - name: 'punctuation.definition.string.begin.ember-handlebars', - }, - }, - end: '"', - endCaptures: { - 0: { - name: 'punctuation.definition.string.end.ember-handlebars', - }, - }, - patterns: [ - { - name: 'constant.character.escape.ember-handlebars', - match: '\\\\"', - }, - ], - }, - 'string-single-quoted-handlebars': { - name: 'string.quoted.single.ember-handlebars', - begin: "'", - beginCaptures: { - 0: { - name: 'punctuation.definition.string.begin.ember-handlebars', - }, - }, - end: "'", - endCaptures: { - 0: { - name: 'punctuation.definition.string.end.ember-handlebars', - }, - }, - patterns: [ - { - name: 'constant.character.escape.ember-handlebars', - match: "\\\\'", - }, - ], - }, - 'string-double-quoted-html': { - name: 'string.quoted.double.html.ember-handlebars', - begin: '"', - beginCaptures: { - 0: { - name: 'punctuation.definition.string.begin.ember-handlebars', - }, - }, - end: '"', - endCaptures: { - 0: { - name: 'punctuation.definition.string.end.ember-handlebars', - }, - }, - patterns: [ - { - name: 'constant.character.escape.ember-handlebars', - match: '\\\\"', - }, - { - include: '#glimmer-bools', - }, - { - include: '#glimmer-expression-property', - }, - { - include: '#glimmer-control-expression', - }, - { - include: '#glimmer-expression', - }, - { - include: '#glimmer-block', - }, - ], - }, - 'string-single-quoted-html': { - name: 'string.quoted.single.html.ember-handlebars', - begin: "'", - beginCaptures: { - 0: { - name: 'punctuation.definition.string.begin.ember-handlebars', - }, - }, - end: "'", - endCaptures: { - 0: { - name: 'punctuation.definition.string.end.ember-handlebars', - }, - }, - patterns: [ - { - name: 'constant.character.escape.ember-handlebars', - match: "\\\\'", - }, - { - include: '#glimmer-bools', - }, - { - include: '#glimmer-expression-property', - }, - { - include: '#glimmer-control-expression', - }, - { - include: '#glimmer-expression', - }, - { - include: '#glimmer-block', - }, - ], - }, - boolean: { - match: 'true|false|undefined|null', - captures: { - 0: { - name: 'string.regexp', - }, - 1: { - name: 'string.regexp', - }, - 2: { - name: 'string.regexp', - }, - }, - patterns: [], - }, - digit: { - match: '\\d*(\\.)?\\d+', - captures: { - 0: { - name: 'constant.numeric', - }, - 1: { - name: 'constant.numeric', - }, - 2: { - name: 'constant.numeric', - }, - }, - patterns: [], - }, - param: { - match: '(@|this.)([a-zA-Z0-9_.-]+)', - captures: { - 0: { - name: 'support.function', - patterns: [ - { - name: 'variable.language', - match: '(@|this)', - }, - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - 1: { - name: 'support.function', - patterns: [ - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - }, - patterns: [], - }, - attention: { - name: 'storage.type.class.${1:/downcase}', - match: '@?(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|TEMP)\\b', - patterns: [], - }, - 'glimmer-unescaped-expression': { - name: 'entity.unescaped.expression.ember-handlebars', - begin: '{{{', - end: '}}}', - captures: { - 0: { - name: 'keyword.operator', - }, - }, - patterns: [ - { - include: '#string-single-quoted-handlebars', - }, - { - include: '#string-double-quoted-handlebars', - }, - { - include: '#glimmer-subexp', - }, - { - include: '#param', - }, - ], - }, - 'glimmer-comment-block': { - name: 'comment.block.glimmer', - begin: '{{!--', - end: '--}}', - captures: { - 0: { - name: 'punctuation.definition.block.comment.glimmer', - }, - }, - patterns: [ - { - include: '#script', - }, - { - include: '#attention', - }, - ], - }, - 'glimmer-comment-inline': { - name: 'comment.inline.glimmer', - begin: '{{!', - end: '}}', - captures: { - 0: { - name: 'punctuation.definition.block.comment.glimmer', - }, - }, - patterns: [ - { - include: '#script', - }, - { - include: '#attention', - }, - ], - }, - 'glimmer-bools': { - name: 'entity.expression.ember-handlebars', - match: '({{~?)(true|false|null|undefined|\\d*(\\.)?\\d+)(~?}})', - captures: { - 0: { - name: 'keyword.operator', - }, - 1: { - name: 'keyword.operator', - }, - 2: { - name: 'string.regexp', - }, - 3: { - name: 'string.regexp', - }, - 4: { - name: 'keyword.operator', - }, - }, - }, - 'glimmer-else-block': { - name: 'entity.expression.ember-handlebars', - match: '({{~?)(else\\s[a-z]+\\s|else)([()@a-zA-Z0-9\\.\\s\\b]+)?(~?}})', - captures: { - 0: { - name: 'punctuation.definition.tag', - }, - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'keyword.control', - }, - 3: { - name: 'keyword.control', - patterns: [ - { - include: '#glimmer-subexp', - }, - { - include: '#string-single-quoted-handlebars', - }, - { - include: '#string-double-quoted-handlebars', - }, - { - include: '#boolean', - }, - { - include: '#digit', - }, - { - include: '#param', - }, - { - include: '#glimmer-parameter-name', - }, - { - include: '#glimmer-parameter-value', - }, - ], - }, - 4: { - name: 'punctuation.definition.tag', - }, - }, - }, - 'glimmer-special-block': { - name: 'entity.expression.ember-handlebars', - match: '({{~?)(yield|outlet)(~?}})', - captures: { - 0: { - name: 'keyword.operator', - }, - 1: { - name: 'keyword.operator', - }, - 2: { - name: 'keyword.control', - }, - 3: { - name: 'keyword.operator', - }, - }, - }, - 'glimmer-as-stuff': { - patterns: [ - { - include: '#as-keyword', - }, - { - include: '#as-params', - }, - ], - }, - 'glimmer-block': { - name: 'entity.expression.ember-handlebars', - begin: '({{~?)(#|/)(([@\\$a-zA-Z0-9_/.-]+))', - end: '(~?}})', - captures: { - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'punctuation.definition.tag', - }, - 3: { - name: 'keyword.control', - patterns: [ - { - include: '#glimmer-component-path', - }, - { - name: 'punctuation.definition.tag', - match: '(\\/)+', - }, - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - }, - patterns: [ - { - include: '#glimmer-as-stuff', - }, - { - include: '#glimmer-supexp-content', - }, - ], - }, - 'glimmer-expression-property': { - name: 'entity.expression.ember-handlebars', - begin: '({{~?)((@|this.)([a-zA-Z0-9_.-]+))', - end: '(~?}})', - captures: { - 1: { - name: 'keyword.operator', - }, - 2: { - name: 'keyword.operator', - }, - 3: { - name: 'support.function', - patterns: [ - { - name: 'variable.language', - match: '(@|this)', - }, - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - 4: { - name: 'support.function', - patterns: [ - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - }, - patterns: [ - { - include: '#glimmer-supexp-content', - }, - ], - }, - 'glimmer-expression': { - name: 'entity.expression.ember-handlebars', - begin: '({{~?)(([()\\s@a-zA-Z0-9_.-]+))', - end: '(~?}})', - captures: { - 1: { - name: 'keyword.operator', - }, - 2: { - name: 'keyword.operator', - }, - 3: { - name: 'support.function', - patterns: [ - { - name: 'string.regexp', - match: '[(]+', - }, - { - name: 'string.regexp', - match: '[)]+', - }, - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - { - include: '#glimmer-supexp-content', - }, - ], - }, - }, - patterns: [ - { - include: '#glimmer-supexp-content', - }, - ], - }, - 'glimmer-supexp-content': { - patterns: [ - { - include: '#glimmer-subexp', - }, - { - include: '#string-single-quoted-handlebars', - }, - { - include: '#string-double-quoted-handlebars', - }, - { - include: '#boolean', - }, - { - include: '#digit', - }, - { - include: '#param', - }, - { - include: '#glimmer-parameter-name', - }, - { - include: '#glimmer-parameter-value', - }, - ], - }, - 'glimmer-control-expression': { - name: 'entity.expression.ember-handlebars', - begin: '({{~?)(([-a-zA-Z_0-9/]+)\\s)', - end: '(~?}})', - captures: { - 1: { - name: 'keyword.operator', - }, - 2: { - name: 'keyword.operator', - }, - 3: { - name: 'keyword.control', - }, - }, - patterns: [ - { - include: '#glimmer-supexp-content', - }, - ], - }, - 'glimmer-subexp': { - name: 'entity.subexpression.ember-handlebars', - begin: '(\\()([@a-zA-Z0-9.-]+)', - end: '(\\))', - captures: { - 1: { - name: 'keyword.other', - }, - 2: { - name: 'keyword.control', - }, - }, - patterns: [ - { - include: '#glimmer-supexp-content', - }, - ], - }, - 'as-keyword': { - name: 'keyword.control', - match: '\\s\\b(as)\\b(?=\\s\\|)', - patterns: [], - }, - 'as-params': { - name: 'keyword.block-params.ember-handlebars', - begin: '(?)', - beginCaptures: { - 0: { - name: 'meta.tag.metadata.style.start.html', - }, - 1: { - name: 'punctuation.definition.tag.begin.html', - }, - 2: { - name: 'entity.name.tag.html', - }, - }, - end: '(?i)((<)/)(style)\\s*(>)', - endCaptures: { - 0: { - name: 'meta.tag.metadata.style.end.html', - }, - 1: { - name: 'punctuation.definition.tag.begin.html', - }, - 2: { - name: 'source.css-ignored-vscode', - }, - 3: { - name: 'entity.name.tag.html', - }, - 4: { - name: 'punctuation.definition.tag.end.html', - }, - }, - name: 'meta.embedded.block.html', - patterns: [ - { - begin: '\\G', - captures: { - 1: { - name: 'punctuation.definition.tag.end.html', - }, - }, - end: '(>)', - name: 'meta.tag.metadata.style.start.html', - patterns: [ - { - include: '#glimmer-argument', - }, - { - include: '#html-attribute', - }, - ], - }, - { - begin: '(?!\\G)', - end: '(?=)', - endCaptures: { - 0: { - name: 'meta.tag.metadata.script.end.html', - }, - 1: { - name: 'punctuation.definition.tag.begin.html', - }, - 2: { - name: 'entity.name.tag.html', - }, - 3: { - name: 'punctuation.definition.tag.end.html', - }, - }, - name: 'meta.embedded.block.html', - patterns: [ - { - begin: '\\G', - end: '(?=/)', - patterns: [ - { - begin: '(>)', - beginCaptures: { - 0: { - name: 'meta.tag.metadata.script.start.html', - }, - 1: { - name: 'punctuation.definition.tag.end.html', - }, - }, - end: '((<))(?=/(?i:script))', - endCaptures: { - 0: { - name: 'meta.tag.metadata.script.end.html', - }, - 1: { - name: 'punctuation.definition.tag.begin.html', - }, - 2: { - name: 'source.js-ignored-vscode', - }, - }, - patterns: [ - { - begin: '\\G', - end: '(?=]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)', - end: '((<))(?=/(?i:script))', - endCaptures: { - 0: { - name: 'meta.tag.metadata.script.end.html', - }, - 1: { - name: 'punctuation.definition.tag.begin.html', - }, - 2: { - name: 'text.html.basic', - }, - }, - patterns: [ - { - begin: '(?!\\G)', - end: '(?=', - captures: { - 0: { - name: 'punctuation.definition.comment.html.ember-handlebars', - }, - }, - patterns: [ - { - include: '#attention', - }, - { - match: '--', - name: 'invalid.illegal.bad-comments-or-CDATA.html.ember-handlebars', - }, - ], - }, - 'tag-like-content': { - patterns: [ - { - include: '#glimmer-bools', - }, - { - include: '#glimmer-unescaped-expression', - }, - { - include: '#glimmer-comment-block', - }, - { - include: '#glimmer-comment-inline', - }, - { - include: '#glimmer-expression-property', - }, - { - include: '#boolean', - }, - { - include: '#digit', - }, - { - include: '#glimmer-control-expression', - }, - { - include: '#glimmer-expression', - }, - { - include: '#glimmer-block', - }, - { - include: '#string-double-quoted-html', - }, - { - include: '#string-single-quoted-html', - }, - { - include: '#glimmer-as-stuff', - }, - { - include: '#glimmer-argument', - }, - { - include: '#html-attribute', - }, - ], - }, - 'component-tag': { - name: 'meta.tag.any.ember-handlebars', - begin: '(<\\/?)(@|this.)?([a-zA-Z0-9-_\\$:\\.]+)\\b', - beginCaptures: { - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'support.function', - patterns: [ - { - name: 'variable.language', - match: '(@|this)', - }, - { - name: 'punctuation.definition.tag', - match: '(\\.)+', - }, - ], - }, - 3: { - name: 'entity.name.type', - patterns: [ - { - include: '#glimmer-component-path', - }, - { - name: 'markup.bold', - match: '(@|:|\\$)', - }, - ], - }, - }, - end: '(\\/?)(>)', - endCaptures: { - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'punctuation.definition.tag', - }, - }, - patterns: [ - { - include: '#tag-like-content', - }, - ], - }, - 'html-tag': { - name: 'meta.tag.any.ember-handlebars', - begin: '(<\\/?)([a-z0-9-]+)(?!\\.|:)\\b', - beginCaptures: { - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'entity.name.tag.html.ember-handlebars', - }, - }, - end: '(\\/?)(>)', - endCaptures: { - 1: { - name: 'punctuation.definition.tag', - }, - 2: { - name: 'punctuation.definition.tag', - }, - }, - patterns: [ - { - include: '#tag-like-content', - }, - ], - }, - 'glimmer-argument': { - match: '\\s(@[a-zA-Z0-9:_.-]+)(=)?', - captures: { - 1: { - name: 'entity.other.attribute-name.ember-handlebars.argument', - patterns: [ - { - name: 'markup.italic', - match: '(@)', - }, - ], - }, - 2: { - name: 'punctuation.separator.key-value.html.ember-handlebars', - }, - }, - }, - 'html-attribute': { - match: '\\s([a-zA-Z0-9:_.-]+)(=)?', - captures: { - 1: { - name: 'entity.other.attribute-name.ember-handlebars', - patterns: [ - { - name: 'markup.bold', - match: '(\\.\\.\\.attributes)', - }, - ], - }, - 2: { - name: 'punctuation.separator.key-value.html.ember-handlebars', - }, - }, - }, - entities: { - patterns: [ - { - name: 'constant.character.entity.html.ember-handlebars', - match: '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)', - captures: { - 1: { - name: 'punctuation.definition.entity.html.ember-handlebars', - }, - 3: { - name: 'punctuation.definition.entity.html.ember-handlebars', - }, - }, - }, - { - name: 'invalid.illegal.bad-ampersand.html.ember-handlebars', - match: '&', - }, - ], - }, - }, -}; diff --git a/packages/vscode/syntaxes/text.html.ember-handlebars.json b/packages/vscode/syntaxes/text.html.ember-handlebars.json deleted file mode 100644 index f9feab32c..000000000 --- a/packages/vscode/syntaxes/text.html.ember-handlebars.json +++ /dev/null @@ -1,1084 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "Glimmer", - "scopeName": "text.html.ember-handlebars", - "fileTypes": ["hbs"], - "patterns": [ - { - "include": "#style" - }, - { - "include": "#script" - }, - { - "include": "#glimmer-else-block" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-special-block" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#html-tag" - }, - { - "include": "#component-tag" - }, - { - "include": "#html-comment" - }, - { - "include": "#entities" - } - ], - "repository": { - "glimmer-component-path": { - "match": "(::|_|\\$|\\.)", - "captures": { - "1": { - "name": "punctuation.definition.tag" - } - } - }, - "string-double-quoted-handlebars": { - "name": "string.quoted.double.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - } - ] - }, - "string-single-quoted-handlebars": { - "name": "string.quoted.single.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - } - ] - }, - "string-double-quoted-html": { - "name": "string.quoted.double.html.ember-handlebars", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\\"" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "string-single-quoted-html": { - "name": "string.quoted.single.html.ember-handlebars", - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.ember-handlebars" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.ember-handlebars" - } - }, - "patterns": [ - { - "name": "constant.character.escape.ember-handlebars", - "match": "\\\\'" - }, - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - } - ] - }, - "boolean": { - "match": "true|false|undefined|null", - "captures": { - "0": { - "name": "string.regexp" - }, - "1": { - "name": "string.regexp" - }, - "2": { - "name": "string.regexp" - } - }, - "patterns": [] - }, - "digit": { - "match": "\\d*(\\.)?\\d+", - "captures": { - "0": { - "name": "constant.numeric" - }, - "1": { - "name": "constant.numeric" - }, - "2": { - "name": "constant.numeric" - } - }, - "patterns": [] - }, - "param": { - "match": "(@|this.)([a-zA-Z0-9_.-]+)", - "captures": { - "0": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "1": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [] - }, - "attention": { - "name": "storage.type.class.${1:/downcase}", - "match": "@?(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|TEMP)\\b", - "patterns": [] - }, - "glimmer-unescaped-expression": { - "name": "entity.unescaped.expression.ember-handlebars", - "begin": "{{{", - "end": "}}}", - "captures": { - "0": { - "name": "keyword.operator" - } - }, - "patterns": [ - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#glimmer-subexp" - }, - { - "include": "#param" - } - ] - }, - "glimmer-comment-block": { - "name": "comment.block.glimmer", - "begin": "{{!--", - "end": "--}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-comment-inline": { - "name": "comment.inline.glimmer", - "begin": "{{!", - "end": "}}", - "captures": { - "0": { - "name": "punctuation.definition.block.comment.glimmer" - } - }, - "patterns": [ - { - "include": "#script" - }, - { - "include": "#attention" - } - ] - }, - "glimmer-bools": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(true|false|null|undefined|\\d*(\\.)?\\d+)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "string.regexp" - }, - "3": { - "name": "string.regexp" - }, - "4": { - "name": "keyword.operator" - } - } - }, - "glimmer-else-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(else\\s[a-z]+\\s|else)([()@a-zA-Z0-9\\.\\s\\b]+)?(~?}})", - "captures": { - "0": { - "name": "punctuation.definition.tag" - }, - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "4": { - "name": "punctuation.definition.tag" - } - } - }, - "glimmer-special-block": { - "name": "entity.expression.ember-handlebars", - "match": "({{~?)(yield|outlet)(~?}})", - "captures": { - "0": { - "name": "keyword.operator" - }, - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.control" - }, - "3": { - "name": "keyword.operator" - } - } - }, - "glimmer-as-stuff": { - "patterns": [ - { - "include": "#as-keyword" - }, - { - "include": "#as-params" - } - ] - }, - "glimmer-block": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(#|/)(([@\\$a-zA-Z0-9_/.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - }, - "3": { - "name": "keyword.control", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\/)+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression-property": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)((@|this.)([a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "4": { - "name": "support.function", - "patterns": [ - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([()\\s@a-zA-Z0-9_.-]+))", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "support.function", - "patterns": [ - { - "name": "string.regexp", - "match": "[(]+" - }, - { - "name": "string.regexp", - "match": "[)]+" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - }, - { - "include": "#glimmer-supexp-content" - } - ] - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-supexp-content": { - "patterns": [ - { - "include": "#glimmer-subexp" - }, - { - "include": "#string-single-quoted-handlebars" - }, - { - "include": "#string-double-quoted-handlebars" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#param" - }, - { - "include": "#glimmer-parameter-name" - }, - { - "include": "#glimmer-parameter-value" - } - ] - }, - "glimmer-control-expression": { - "name": "entity.expression.ember-handlebars", - "begin": "({{~?)(([-a-zA-Z_0-9/]+)\\s)", - "end": "(~?}})", - "captures": { - "1": { - "name": "keyword.operator" - }, - "2": { - "name": "keyword.operator" - }, - "3": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "glimmer-subexp": { - "name": "entity.subexpression.ember-handlebars", - "begin": "(\\()([@a-zA-Z0-9.-]+)", - "end": "(\\))", - "captures": { - "1": { - "name": "keyword.other" - }, - "2": { - "name": "keyword.control" - } - }, - "patterns": [ - { - "include": "#glimmer-supexp-content" - } - ] - }, - "as-keyword": { - "name": "keyword.control", - "match": "\\s\\b(as)\\b(?=\\s\\|)", - "patterns": [] - }, - "as-params": { - "name": "keyword.block-params.ember-handlebars", - "begin": "(?)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.style.start.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(?i)((<)/)(style)\\s*(>)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.style.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.css-ignored-vscode" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "captures": { - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(>)", - "name": "meta.tag.metadata.style.start.html", - "patterns": [ - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - { - "begin": "(?!\\G)", - "end": "(?=)", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "entity.name.tag.html" - }, - "3": { - "name": "punctuation.definition.tag.end.html" - } - }, - "name": "meta.embedded.block.html", - "patterns": [ - { - "begin": "\\G", - "end": "(?=/)", - "patterns": [ - { - "begin": "(>)", - "beginCaptures": { - "0": { - "name": "meta.tag.metadata.script.start.html" - }, - "1": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "source.js-ignored-vscode" - } - }, - "patterns": [ - { - "begin": "\\G", - "end": "(?=]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)", - "end": "((<))(?=/(?i:script))", - "endCaptures": { - "0": { - "name": "meta.tag.metadata.script.end.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - }, - "2": { - "name": "text.html.basic" - } - }, - "patterns": [ - { - "begin": "(?!\\G)", - "end": "(?=", - "captures": { - "0": { - "name": "punctuation.definition.comment.html.ember-handlebars" - } - }, - "patterns": [ - { - "include": "#attention" - }, - { - "match": "--", - "name": "invalid.illegal.bad-comments-or-CDATA.html.ember-handlebars" - } - ] - }, - "tag-like-content": { - "patterns": [ - { - "include": "#glimmer-bools" - }, - { - "include": "#glimmer-unescaped-expression" - }, - { - "include": "#glimmer-comment-block" - }, - { - "include": "#glimmer-comment-inline" - }, - { - "include": "#glimmer-expression-property" - }, - { - "include": "#boolean" - }, - { - "include": "#digit" - }, - { - "include": "#glimmer-control-expression" - }, - { - "include": "#glimmer-expression" - }, - { - "include": "#glimmer-block" - }, - { - "include": "#string-double-quoted-html" - }, - { - "include": "#string-single-quoted-html" - }, - { - "include": "#glimmer-as-stuff" - }, - { - "include": "#glimmer-argument" - }, - { - "include": "#html-attribute" - } - ] - }, - "component-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)(@|this.)?([a-zA-Z0-9-_\\$:\\.]+)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "support.function", - "patterns": [ - { - "name": "variable.language", - "match": "(@|this)" - }, - { - "name": "punctuation.definition.tag", - "match": "(\\.)+" - } - ] - }, - "3": { - "name": "entity.name.type", - "patterns": [ - { - "include": "#glimmer-component-path" - }, - { - "name": "markup.bold", - "match": "(@|:|\\$)" - } - ] - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "html-tag": { - "name": "meta.tag.any.ember-handlebars", - "begin": "(<\\/?)([a-z0-9-]+)(?!\\.|:)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "entity.name.tag.html.ember-handlebars" - } - }, - "end": "(\\/?)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag" - }, - "2": { - "name": "punctuation.definition.tag" - } - }, - "patterns": [ - { - "include": "#tag-like-content" - } - ] - }, - "glimmer-argument": { - "match": "\\s(@[a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars.argument", - "patterns": [ - { - "name": "markup.italic", - "match": "(@)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "html-attribute": { - "match": "\\s([a-zA-Z0-9:_.-]+)(=)?", - "captures": { - "1": { - "name": "entity.other.attribute-name.ember-handlebars", - "patterns": [ - { - "name": "markup.bold", - "match": "(\\.\\.\\.attributes)" - } - ] - }, - "2": { - "name": "punctuation.separator.key-value.html.ember-handlebars" - } - } - }, - "entities": { - "patterns": [ - { - "name": "constant.character.entity.html.ember-handlebars", - "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "captures": { - "1": { - "name": "punctuation.definition.entity.html.ember-handlebars" - }, - "3": { - "name": "punctuation.definition.entity.html.ember-handlebars" - } - } - }, - { - "name": "invalid.illegal.bad-ampersand.html.ember-handlebars", - "match": "&" - } - ] - } - } -}