From 36052b7c32e3d6a3fcbeefb44803d0d5f27ac4ee Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Fri, 8 Dec 2023 22:09:38 +1300 Subject: [PATCH] Add Glimmer JS language (#6630) * chore: add Glimmer JS to languages * chore: add vsc-ember-syntax grammar * chore: add Glimmer JS samples * chore: run script/update-ids * fix: run script/sort-submodules * chore: pull updated vsc-ember-syntax submodule * chore: run script/add-grammar --replace vsc-ember-syntax https://github.com/lifeart/vsc-ember-syntax * fix: run script/sort-submodules --- .gitmodules | 3 + grammars.yml | 6 ++ lib/linguist/languages.yml | 9 +++ samples/Glimmer JS/class.gjs | 48 ++++++++++++++++ samples/Glimmer JS/template-only.gjs | 55 +++++++++++++++++++ vendor/README.md | 1 + vendor/grammars/vsc-ember-syntax | 1 + .../git_submodule/vsc-ember-syntax.dep.yml | 24 ++++++++ 8 files changed, 147 insertions(+) create mode 100644 samples/Glimmer JS/class.gjs create mode 100644 samples/Glimmer JS/template-only.gjs create mode 160000 vendor/grammars/vsc-ember-syntax create mode 100644 vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml diff --git a/.gitmodules b/.gitmodules index 4ed1baaa2e..e631499c83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1190,6 +1190,9 @@ [submodule "vendor/grammars/vhdl"] path = vendor/grammars/vhdl url = https://github.com/textmate/vhdl.tmbundle +[submodule "vendor/grammars/vsc-ember-syntax"] + path = vendor/grammars/vsc-ember-syntax + url = https://github.com/lifeart/vsc-ember-syntax.git [submodule "vendor/grammars/vsc-fennel"] path = vendor/grammars/vsc-fennel url = https://github.com/kongeor/vsc-fennel diff --git a/grammars.yml b/grammars.yml index 0046097d76..8290443446 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1063,6 +1063,12 @@ vendor/grammars/verilog.tmbundle: - source.verilog vendor/grammars/vhdl: - source.vhdl +vendor/grammars/vsc-ember-syntax: +- inline.hbs +- inline.template +- source.gjs +- source.gts +- text.html.ember-handlebars vendor/grammars/vsc-fennel: - source.fnl vendor/grammars/vscode-TalonScript: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 9b8304d549..1becf7adcc 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2426,6 +2426,15 @@ Gleam: - ".gleam" tm_scope: source.gleam language_id: 1054258749 +Glimmer JS: + type: programming + extensions: + - ".gjs" + ace_mode: javascript + color: "#F5835F" + tm_scope: source.gjs + group: JavaScript + language_id: 5523150 Glyph: type: programming color: "#c1ac7f" diff --git a/samples/Glimmer JS/class.gjs b/samples/Glimmer JS/class.gjs new file mode 100644 index 0000000000..a3fd9f3b8f --- /dev/null +++ b/samples/Glimmer JS/class.gjs @@ -0,0 +1,48 @@ +import Component from "@glimmer/component"; +import { action } from "@ember/object"; +import DButton from "discourse/components/d-button"; +import DModal from "discourse/components/d-modal"; +import DModalCancel from "discourse/components/d-modal-cancel"; +import I18n from "I18n"; +import { htmlSafe } from "@ember/template"; + +const t = I18n.t.bind(I18n); + +export default class ModalDiffModal extends Component { + + + @action + triggerConfirmChanges() { + this.args.closeModal(); + this.args.confirm(); + } +} diff --git a/samples/Glimmer JS/template-only.gjs b/samples/Glimmer JS/template-only.gjs new file mode 100644 index 0000000000..fa2bd7a2ba --- /dev/null +++ b/samples/Glimmer JS/template-only.gjs @@ -0,0 +1,55 @@ +import { ExternalLink, Link } from '@crowdstrike/ember-oss-docs'; + +export const Footer = + +export default Footer; diff --git a/vendor/README.md b/vendor/README.md index c1d5fd8e41..87e8cdbe48 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -203,6 +203,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Git Config:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) - **Git Revision List:** [Nixinova/NovaGrammars](https://github.com/Nixinova/NovaGrammars) - **Gleam:** [gleam-lang/tree-sitter-gleam](https://github.com/gleam-lang/tree-sitter-gleam) 🐌 +- **Glimmer JS:** [lifeart/vsc-ember-syntax](https://github.com/lifeart/vsc-ember-syntax) - **Glyph:** [textmate/tcl.tmbundle](https://github.com/textmate/tcl.tmbundle) - **Glyph Bitmap Distribution Format:** [Alhadis/language-fontforge](https://github.com/Alhadis/language-fontforge) - **Gnuplot:** [mattfoster/gnuplot-tmbundle](https://github.com/mattfoster/gnuplot-tmbundle) diff --git a/vendor/grammars/vsc-ember-syntax b/vendor/grammars/vsc-ember-syntax new file mode 160000 index 0000000000..3921656e61 --- /dev/null +++ b/vendor/grammars/vsc-ember-syntax @@ -0,0 +1 @@ +Subproject commit 3921656e616580b9036b60a06abc1aa4fb436d64 diff --git a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml new file mode 100644 index 0000000000..b2764e530f --- /dev/null +++ b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml @@ -0,0 +1,24 @@ +--- +name: vsc-ember-syntax +version: 3921656e616580b9036b60a06abc1aa4fb436d64 +type: git_submodule +homepage: https://github.com/lifeart/vsc-ember-syntax.git +license: mit +licenses: +- sources: LICENSE.md + text: "Copyright (c) 2021 Aleksandr Kanunnikov, and contributors.\n\nAll rights + reserved. \n\nMIT License\n\nPermission is hereby granted, free of charge, to + any person obtaining a copy of this software and associated documentation files + (the \"Software\"), to deal in the Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the Software + is furnished to do so, subject to the following conditions:\n\nThe above copyright + notice and this permission notice shall be included in all copies or substantial + portions of the Software.\n\nTHE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY + OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.\n" +notices: []