diff --git a/packages/tm-grammars/NOTICE b/packages/tm-grammars/NOTICE index 5907fa7..0ea58cc 100644 --- a/packages/tm-grammars/NOTICE +++ b/packages/tm-grammars/NOTICE @@ -2460,12 +2460,12 @@ SOFTWARE. ========================================================================================================= Files: glimmer-js.json, glimmer-ts.json -License: https://raw.githubusercontent.com/IgnaceMaes/glimmer-textmate-grammar/main/LICENSE +License: https://raw.githubusercontent.com/lifeart/vsc-ember-syntax/master/LICENSE SPDX: MIT --------------------------------------------------------------------------------------------------------- MIT License -Copyright (c) 2023 Ignace Maes +Copyright (c) 2024 Alex Kanunnikov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/tm-grammars/README.md b/packages/tm-grammars/README.md index 1720f56..66c7dd3 100644 --- a/packages/tm-grammars/README.md +++ b/packages/tm-grammars/README.md @@ -75,8 +75,8 @@ import { grammars } from 'tm-grammars' | `gherkin` | | [alexkrechik/VSCucumberAutoComplete](https://github.com/alexkrechik/VSCucumberAutoComplete/blob/fc8da969b1c83e13ef5124b1ec90ba5211bc1e5f/gclient/syntaxes/feature.tmLanguage) | [MIT](https://raw.githubusercontent.com/alexkrechik/VSCucumberAutoComplete/master/LICENSE) | | 12.13 kB | | `git-commit` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/f8c3f89468fea14103d8790d59ea8594d6e644eb/extensions/git-base/syntaxes/git-commit.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | `diff` | 1.36 kB | | `git-rebase` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/e95c74c4c7af876e79ec58df262464467c06df28/extensions/git-base/syntaxes/git-rebase.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | `shellscript` | 818.00 B | -| `glimmer-js` | `gjs` | [IgnaceMaes/glimmer-textmate-grammar](https://github.com/IgnaceMaes/glimmer-textmate-grammar/blob/1d2850817ee189b5c7e83f02a60b7143e3cd099c/glimmer-js.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/IgnaceMaes/glimmer-textmate-grammar/main/LICENSE) | `javascript` `handlebars` | 1.27 kB | -| `glimmer-ts` | `gts` | [IgnaceMaes/glimmer-textmate-grammar](https://github.com/IgnaceMaes/glimmer-textmate-grammar/blob/1d2850817ee189b5c7e83f02a60b7143e3cd099c/glimmer-ts.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/IgnaceMaes/glimmer-textmate-grammar/main/LICENSE) | `typescript` `handlebars` | 1.27 kB | +| `glimmer-js` | `gjs` | [lifeart/vsc-ember-syntax](https://github.com/lifeart/vsc-ember-syntax/blob/f031ed7df2eeced760f4469fc9fe06f8688c531a/syntaxes/source.gjs.json) | [MIT](https://raw.githubusercontent.com/lifeart/vsc-ember-syntax/master/LICENSE) | `javascript` `typescript` `css` `html` | 19.08 kB | +| `glimmer-ts` | `gts` | [lifeart/vsc-ember-syntax](https://github.com/lifeart/vsc-ember-syntax/blob/f031ed7df2eeced760f4469fc9fe06f8688c531a/syntaxes/source.gts.json) | [MIT](https://raw.githubusercontent.com/lifeart/vsc-ember-syntax/master/LICENSE) | `typescript` `css` `javascript` `html` | 19.08 kB | | `glsl` | | [polym0rph/GLSL.tmbundle](https://github.com/polym0rph/GLSL.tmbundle/blob/6998d3bbd204e26746a5ca580cda4c650b9057b1/Syntaxes/GLSL.tmLanguage) | | `c` | 3.69 kB | | `gnuplot` | | [MarioSchwalbe/vscode-gnuplot](https://github.com/MarioSchwalbe/vscode-gnuplot/blob/c62c1a61c9b6b4658b43d76c397dc2ad43523b6a/syntaxes/gnuplot.tmLanguage) | [GPL-3.0](https://raw.githubusercontent.com/MarioSchwalbe/vscode-gnuplot/master/LICENSE) | | 16.46 kB | | `go` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/35d97bc7e439fce0f50f42074041ab2d8571b20a/extensions/go/syntaxes/go.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | | 41.19 kB | diff --git a/packages/tm-grammars/grammars/glimmer-js.json b/packages/tm-grammars/grammars/glimmer-js.json index e13a3d3..d3801c3 100644 --- a/packages/tm-grammars/grammars/glimmer-js.json +++ b/packages/tm-grammars/grammars/glimmer-js.json @@ -1,98 +1,1500 @@ { "displayName": "Glimmer JS", "injections": { - "L:source.gjs -comment -string": { + "L:source.gjs -comment -(string -meta.embedded)": { + "patterns": [ + { + "include": "#main" + } + ] + } + }, + "name": "glimmer-js", + "patterns": [ + { + "include": "source.js" + }, + { + "include": "#main" + } + ], + "repository": { + "as-keyword": { + "match": "\\s\\b(as)\\b(?=\\s\\|)", + "name": "keyword.control", + "patterns": [ + ] + }, + "as-params": { + "begin": "(?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag" + }, + "2": { + "name": "punctuation.definition.tag" + } + }, + "name": "meta.tag.any.ember-handlebars", + "patterns": [ + { + "include": "#tag-like-content" + } + ] + }, + "digit": { + "captures": { + "0": { + "name": "constant.numeric" + }, + "1": { + "name": "constant.numeric" + }, + "2": { + "name": "constant.numeric" + } + }, + "match": "\\d*(\\.)?\\d+", + "patterns": [ + ] + }, + "entities": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.entity.html.ember-handlebars" + }, + "3": { + "name": "punctuation.definition.entity.html.ember-handlebars" + } + }, + "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", + "name": "constant.character.entity.html.ember-handlebars" + }, + { + "match": "&", + "name": "invalid.illegal.bad-ampersand.html.ember-handlebars" + } + ] + }, + "glimmer-argument": { + "captures": { + "1": { + "name": "entity.other.attribute-name.ember-handlebars.argument", + "patterns": [ + { + "match": "(@)", + "name": "markup.italic" + } + ] + }, + "2": { + "name": "punctuation.separator.key-value.html.ember-handlebars" + } + }, + "match": "\\s(@[a-zA-Z0-9:_.-]+)(=)?" + }, + "glimmer-as-stuff": { + "patterns": [ + { + "include": "#as-keyword" + }, + { + "include": "#as-params" + } + ] + }, + "glimmer-block": { + "begin": "({{~?)(#|/)(([@\\$a-zA-Z0-9_/.-]+))", + "captures": { + "1": { + "name": "punctuation.definition.tag" + }, + "2": { + "name": "punctuation.definition.tag" + }, + "3": { + "name": "keyword.control", + "patterns": [ + { + "include": "#glimmer-component-path" + }, + { + "match": "(\\/)+", + "name": "punctuation.definition.tag" + }, + { + "match": "(\\.)+", + "name": "punctuation.definition.tag" + } + ] + } + }, + "end": "(~?}})", + "name": "entity.expression.ember-handlebars", + "patterns": [ + { + "include": "#glimmer-as-stuff" + }, + { + "include": "#glimmer-supexp-content" + } + ] + }, + "glimmer-bools": { + "captures": { + "0": { + "name": "keyword.operator" + }, + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "string.regexp" + }, + "3": { + "name": "string.regexp" + }, + "4": { + "name": "keyword.operator" + } + }, + "match": "({{~?)(true|false|null|undefined|\\d*(\\.)?\\d+)(~?}})", + "name": "entity.expression.ember-handlebars" + }, + "glimmer-comment-block": { + "begin": "{{!--", + "captures": { + "0": { + "name": "punctuation.definition.block.comment.glimmer" + } + }, + "end": "--}}", + "name": "comment.block.glimmer", + "patterns": [ + { + "include": "#script" + }, + { + "include": "#attention" + } + ] + }, + "glimmer-comment-inline": { + "begin": "{{!", + "captures": { + "0": { + "name": "punctuation.definition.block.comment.glimmer" + } + }, + "end": "}}", + "name": "comment.inline.glimmer", + "patterns": [ + { + "include": "#script" + }, + { + "include": "#attention" + } + ] + }, + "glimmer-component-path": { + "captures": { + "1": { + "name": "punctuation.definition.tag" + } + }, + "match": "(::|_|\\$|\\.)" + }, + "glimmer-control-expression": { + "begin": "({{~?)(([-a-z/]+)\\s)", + "captures": { + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "keyword.operator" + }, + "3": { + "name": "keyword.control" + } + }, + "end": "(~?}})", + "name": "entity.expression.ember-handlebars", + "patterns": [ + { + "include": "#glimmer-supexp-content" + } + ] + }, + "glimmer-else-block": { + "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" + } + }, + "match": "({{~?)(else\\s[a-z]+\\s|else)([()@a-zA-Z0-9\\.\\s\\b]+)?(~?}})", + "name": "entity.expression.ember-handlebars" + }, + "glimmer-expression": { + "begin": "({{~?)(([()\\s@a-zA-Z0-9_.-]+))", + "captures": { + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "keyword.operator" + }, + "3": { + "name": "support.function", + "patterns": [ + { + "match": "[(]+", + "name": "string.regexp" + }, + { + "match": "[)]+", + "name": "string.regexp" + }, + { + "match": "(\\.)+", + "name": "punctuation.definition.tag" + }, + { + "include": "#glimmer-supexp-content" + } + ] + } + }, + "end": "(~?}})", + "name": "entity.expression.ember-handlebars", + "patterns": [ + { + "include": "#glimmer-supexp-content" + } + ] + }, + "glimmer-expression-property": { + "begin": "({{~?)((@|this.)([a-zA-Z0-9_.-]+))", + "captures": { + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "keyword.operator" + }, + "3": { + "name": "support.function", + "patterns": [ + { + "match": "(@|this)", + "name": "variable.language" + }, + { + "match": "(\\.)+", + "name": "punctuation.definition.tag" + } + ] + }, + "4": { + "name": "support.function", + "patterns": [ + { + "match": "(\\.)+", + "name": "punctuation.definition.tag" + } + ] + } + }, + "end": "(~?}})", + "name": "entity.expression.ember-handlebars", + "patterns": [ + { + "include": "#glimmer-supexp-content" + } + ] + }, + "glimmer-parameter-name": { + "captures": { + "1": { + "name": "variable.parameter.name.ember-handlebars" + }, + "2": { + "name": "punctuation.definition.expression.ember-handlebars" + } + }, + "match": "\\b([a-zA-Z0-9_-]+)(\\s?=)", + "patterns": [ + ] + }, + "glimmer-parameter-value": { + "captures": { + "1": { + "name": "support.function", + "patterns": [ + { + "match": "(\\.)+", + "name": "punctuation.definition.tag" + } + ] + } + }, + "match": "\\b([a-zA-Z0-9:_.-]+)\\b(?!=)", + "patterns": [ + ] + }, + "glimmer-special-block": { + "captures": { + "0": { + "name": "keyword.operator" + }, + "1": { + "name": "keyword.operator" + }, + "2": { + "name": "keyword.control" + }, + "3": { + "name": "keyword.operator" + } + }, + "match": "({{~?)(yield|outlet)(~?}})", + "name": "entity.expression.ember-handlebars" + }, + "glimmer-subexp": { + "begin": "(\\()([@a-zA-Z0-9.-]+)", + "captures": { + "1": { + "name": "keyword.other" + }, + "2": { + "name": "keyword.control" + } + }, + "end": "(\\))", + "name": "entity.subexpression.ember-handlebars", + "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-unescaped-expression": { + "begin": "{{{", + "captures": { + "0": { + "name": "keyword.operator" + } + }, + "end": "}}}", + "name": "entity.unescaped.expression.ember-handlebars", + "patterns": [ + { + "include": "#string-single-quoted-handlebars" + }, + { + "include": "#string-double-quoted-handlebars" + }, + { + "include": "#glimmer-subexp" + }, + { + "include": "#param" + } + ] + }, + "html-attribute": { + "captures": { + "1": { + "name": "entity.other.attribute-name.ember-handlebars", + "patterns": [ + { + "match": "(\\.\\.\\.attributes)", + "name": "markup.bold" + } + ] + }, + "2": { + "name": "punctuation.separator.key-value.html.ember-handlebars" + } + }, + "match": "\\s([a-zA-Z0-9:_.-]+)(=)?" + }, + "html-comment": { + "begin": "