From 48fad6ffcf90f83e7dbc59ab6889b5d47d80a0bb Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 9 Dec 2023 12:24:46 +1300 Subject: [PATCH 1/9] Add Glimmer TS language --- lib/linguist/languages.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 3441a3f316..6caaa95290 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2435,6 +2435,14 @@ Glimmer JS: tm_scope: source.gjs group: JavaScript language_id: 5523150 +Glimmer TS: + type: programming + extensions: + - ".gts" + ace_mode: typescript + color: "#3178c6" + tm_scope: source.gts + group: TypeScript Glyph: type: programming color: "#c1ac7f" From 22570b7b5332ac488759cbd06292d23cb2aed18f Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 9 Dec 2023 12:26:07 +1300 Subject: [PATCH 2/9] Add Glimmer TS samples --- samples/Glimmer TS/class.gts | 58 ++++++++++++++++++++++++++++ samples/Glimmer TS/template-only.gts | 48 +++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 samples/Glimmer TS/class.gts create mode 100644 samples/Glimmer TS/template-only.gts diff --git a/samples/Glimmer TS/class.gts b/samples/Glimmer TS/class.gts new file mode 100644 index 0000000000..d767144c63 --- /dev/null +++ b/samples/Glimmer TS/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 TS/template-only.gts b/samples/Glimmer TS/template-only.gts new file mode 100644 index 0000000000..05b2892cd1 --- /dev/null +++ b/samples/Glimmer TS/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 From eb6ec149b19df7b52e8054baa124abd8541c5e07 Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 9 Dec 2023 12:27:22 +1300 Subject: [PATCH 3/9] Run script/update-ids --- lib/linguist/languages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 6caaa95290..0b49b6e4f1 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2443,6 +2443,7 @@ Glimmer TS: color: "#3178c6" tm_scope: source.gts group: TypeScript + language_id: 95110458 Glyph: type: programming color: "#c1ac7f" From 17f05e0b2e7aa6f888fa4931ab38acf647d81cd2 Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 9 Dec 2023 12:29:00 +1300 Subject: [PATCH 4/9] Added a naive heuristic to disambiguate .gts files between Gerber Image and Glimmer TS languages --- lib/linguist/heuristics.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml index ef0d00ca89..fffdf2b19f 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 TS + negative_pattern: '^G0.' - extensions: ['.h'] rules: - language: Objective-C From 4976ce482e28fc6d6fc274393b81b65f9dd53887 Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Fri, 22 Sep 2023 13:53:51 +1200 Subject: [PATCH 5/9] Add heuristic test for gts files --- test/test_heuristics.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 2193758bba..513a1ffe9c 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 Image" => all_fixtures("Gerber Image", "*.gts"), + "Glimmer TS" => all_fixtures("Glimmer TS", "*.gts"), + }) + end + def test_h_by_heuristics assert_heuristics({ "Objective-C" => all_fixtures("Objective-C", "*.h"), From f74d1dbb647746cad24c84cd22e41860211bafb9 Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 9 Dec 2023 12:38:18 +1300 Subject: [PATCH 6/9] Run script/list-grammars --- vendor/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/README.md b/vendor/README.md index 62c31c6228..2dfc326113 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -204,6 +204,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **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) +- **Glimmer TS:** [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) From e0fea7c298226c55227e94652051e2469703fcc7 Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Sat, 23 Dec 2023 12:02:02 +1300 Subject: [PATCH 7/9] Update grammar submodule for vsc-ember-syntax --- vendor/grammars/vsc-ember-syntax | 2 +- vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/grammars/vsc-ember-syntax b/vendor/grammars/vsc-ember-syntax index 3921656e61..cbb8f92f6f 160000 --- a/vendor/grammars/vsc-ember-syntax +++ b/vendor/grammars/vsc-ember-syntax @@ -1 +1 @@ -Subproject commit 3921656e616580b9036b60a06abc1aa4fb436d64 +Subproject commit cbb8f92f6f7fdb918146c39f94c6d7c8dca005f3 diff --git a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml index b2764e530f..abb8a8597b 100644 --- a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml +++ b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml @@ -1,6 +1,6 @@ --- name: vsc-ember-syntax -version: 3921656e616580b9036b60a06abc1aa4fb436d64 +version: cbb8f92f6f7fdb918146c39f94c6d7c8dca005f3 type: git_submodule homepage: https://github.com/lifeart/vsc-ember-syntax.git license: mit From 2d0e453d6ae4eb53f63ef7e7755e207d7a57d0bd Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Fri, 19 Jan 2024 14:23:12 +1300 Subject: [PATCH 8/9] Update grammar submodule for vsc-ember-syntax --- vendor/grammars/vsc-ember-syntax | 2 +- vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/grammars/vsc-ember-syntax b/vendor/grammars/vsc-ember-syntax index cbb8f92f6f..e45d89e771 160000 --- a/vendor/grammars/vsc-ember-syntax +++ b/vendor/grammars/vsc-ember-syntax @@ -1 +1 @@ -Subproject commit cbb8f92f6f7fdb918146c39f94c6d7c8dca005f3 +Subproject commit e45d89e771bf0aba9cc4a85e7c3835878d3054e9 diff --git a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml index abb8a8597b..dcbca6d13e 100644 --- a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml +++ b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml @@ -1,6 +1,6 @@ --- name: vsc-ember-syntax -version: cbb8f92f6f7fdb918146c39f94c6d7c8dca005f3 +version: e45d89e771bf0aba9cc4a85e7c3835878d3054e9 type: git_submodule homepage: https://github.com/lifeart/vsc-ember-syntax.git license: mit From 51f9cb089fd218ddf8168cfdd83b0627eb726ede Mon Sep 17 00:00:00 2001 From: Giles Thompson Date: Tue, 5 Mar 2024 19:57:50 +1300 Subject: [PATCH 9/9] Update grammar submodule for vsc-ember-syntax --- vendor/grammars/vsc-ember-syntax | 2 +- vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/grammars/vsc-ember-syntax b/vendor/grammars/vsc-ember-syntax index e45d89e771..e92ccb2776 160000 --- a/vendor/grammars/vsc-ember-syntax +++ b/vendor/grammars/vsc-ember-syntax @@ -1 +1 @@ -Subproject commit e45d89e771bf0aba9cc4a85e7c3835878d3054e9 +Subproject commit e92ccb2776c37a538eee5eee09c444cff799c59a diff --git a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml index dcbca6d13e..10a9a85987 100644 --- a/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml +++ b/vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml @@ -1,6 +1,6 @@ --- name: vsc-ember-syntax -version: e45d89e771bf0aba9cc4a85e7c3835878d3054e9 +version: e92ccb2776c37a538eee5eee09c444cff799c59a type: git_submodule homepage: https://github.com/lifeart/vsc-ember-syntax.git license: mit