diff --git a/.gitmodules b/.gitmodules index e14f0bf03f..34167f404b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1181,6 +1181,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 cf9da731c7..6a96cab22f 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1057,6 +1057,11 @@ vendor/grammars/verilog.tmbundle: - source.verilog vendor/grammars/vhdl: - source.vhdl +vendor/grammars/vsc-ember-syntax: +- inline.hbs +- inline.template +- source.gjs +- source.gts vendor/grammars/vsc-fennel: - source.fnl vendor/grammars/vscode-TalonScript: diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml index 8fb4243867..cbb1f4c742 100644 --- a/lib/linguist/heuristics.yml +++ b/lib/linguist/heuristics.yml @@ -320,6 +320,12 @@ disambiguations: rules: - language: GSC named_pattern: gsc +- extensions: ['.gts'] + rules: + - language: Gerber Image + pattern: '^G0.' + - language: Glimmer + negative_pattern: '^G0.' - extensions: ['.h'] rules: - language: Objective-C diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 88c425287f..6335770734 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2416,6 +2416,15 @@ Gleam: - ".gleam" tm_scope: source.gleam language_id: 1054258749 +Glimmer: + type: programming + extensions: + - ".gjs" + - ".gts" + ace_mode: javascript + color: "#F5835F" + tm_scope: source.js + language_id: 735100269 Glyph: type: programming color: "#c1ac7f" diff --git a/samples/Glimmer/class.gjs b/samples/Glimmer/class.gjs new file mode 100644 index 0000000000..58ec0443ce --- /dev/null +++ b/samples/Glimmer/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(); + } +} \ No newline at end of file diff --git a/samples/Glimmer/class.gts b/samples/Glimmer/class.gts new file mode 100644 index 0000000000..d767144c63 --- /dev/null +++ b/samples/Glimmer/class.gts @@ -0,0 +1,58 @@ +import Component from '@glimmer/component'; +import FreestyleUsage from 'ember-freestyle/components/freestyle/usage'; +import BoxelInputTime, { Time } from './index'; +import { tracked } from '@glimmer/tracking'; +import { cssVariable, CSSVariableInfo } from 'ember-freestyle/decorators/css-variable'; +import { fn } from '@ember/helper'; +import { action } from '@ember/object'; + +export default class BoxelInputTimeUsage extends Component { + cssClassName = 'boxel-input-time'; + + @cssVariable declare boxelInputTimeBackgroundColor: CSSVariableInfo; // TODO: replace or remove + @tracked value = new Date(2022,2,3,13,45); + @tracked minValue = new Date(2022,2,3,11,0); + @tracked minuteInterval = 5; + @action timeChanged(val: Time) { + this.value = val as Date; //TODO: casting??? + } + +} \ No newline at end of file diff --git a/samples/Glimmer/template-only.gjs b/samples/Glimmer/template-only.gjs new file mode 100644 index 0000000000..603deb912b --- /dev/null +++ b/samples/Glimmer/template-only.gjs @@ -0,0 +1,55 @@ +import { ExternalLink, Link } from '@crowdstrike/ember-oss-docs'; + +export const Footer = + +export default Footer; \ No newline at end of file diff --git a/samples/Glimmer/template-only.gts b/samples/Glimmer/template-only.gts new file mode 100644 index 0000000000..05b2892cd1 --- /dev/null +++ b/samples/Glimmer/template-only.gts @@ -0,0 +1,48 @@ +import { LinkTo } from '@ember/routing'; +import { TOC } from '@ember/component/template-only'; +import Resource from 'ember-crate/models/resource'; +import HeroIcon from 'ember-heroicons/components/hero-icon'; + +const formatDate = (date: Date) => { + const options: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric', year: 'numeric' }; + return new Intl.DateTimeFormat('en-US', options).format(new Date(date)); +}; + +export const ResourceCard: TOC<{ Args: { resource: Resource } }> = ; + +export default ResourceCard; \ No newline at end of file diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 8c14018c8d..3456dd144e 100755 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -510,6 +510,13 @@ def test_gsh_by_heuristics }) end + def test_gts_by_heuristics + assert_heuristics({ + "Gerber" => all_fixtures("Gerber", "*.gts"), + "Glimmer" => all_fixtures("Glimmer", "*.gts"), + }) + end + def test_h_by_heuristics assert_heuristics({ "Objective-C" => all_fixtures("Objective-C", "*.h"), diff --git a/vendor/README.md b/vendor/README.md index 67f1d452b0..8528d9009a 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -202,6 +202,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:** [atom/language-javascript](https://github.com/atom/language-javascript) - **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..55ca698120 --- /dev/null +++ b/vendor/grammars/vsc-ember-syntax @@ -0,0 +1 @@ +Subproject commit 55ca6981204a1f3934b55057a5a7abbab66a1d8e 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..e196782a71 --- /dev/null +++ b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml @@ -0,0 +1,24 @@ +--- +name: vsc-ember-syntax +version: 55ca6981204a1f3934b55057a5a7abbab66a1d8e +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: []