Skip to content

Commit

Permalink
Add Glimmer JS language (#6578)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gilest authored Dec 6, 2023
1 parent 6c4c9c1 commit a4e2bf9
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,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:
Expand Down
9 changes: 9 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
48 changes: 48 additions & 0 deletions samples/Glimmer JS/class.gjs
Original file line number Diff line number Diff line change
@@ -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 {
<template>
<DModal
class="composer-ai-helper-modal"
@title={{t "discourse_ai.ai_helper.context_menu.changes"}}
@closeModal={{@closeModal}}
>
<:body>
{{#if @diff}}
{{htmlSafe @diff}}
{{else}}
<div class="composer-ai-helper-modal__old-value">
{{@oldValue}}
</div>

<div class="composer-ai-helper-modal__new-value">
{{@newValue}}
</div>
{{/if}}
</:body>

<:footer>
<DButton
class="btn-primary confirm"
@action={{this.triggerConfirmChanges}}
@label="discourse_ai.ai_helper.context_menu.confirm"
/>
<DModalCancel @close={{@closeModal}} />
</:footer>
</DModal>
</template>

@action
triggerConfirmChanges() {
this.args.closeModal();
this.args.confirm();
}
}
55 changes: 55 additions & 0 deletions samples/Glimmer JS/template-only.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { ExternalLink, Link } from '@crowdstrike/ember-oss-docs';

export const Footer = <template>
<footer class="bg-mezzanine theme-mezzanine pb-10 sm:pb-20 md:pb-28 pt-6 sm:pt-10 md:pt-20">
<div class="max-w-screen-lg mx-auto grid gap-4 md:gap-14">
<nav class="p-8 md:p-0 grid sm:flex flex-wrap justify-between">
<div class="flex flex-col items-start">
<Link @variant="quiet" @href="https://www.crowdstrike.com/why-crowdstrike/">Why CrowdStrike</Link>
<Link @variant="quiet" @href="https://www.crowdstrike.com/why-crowdstrike/crowdstrike-customers/">Our Customers</Link>
</div>
<div class="flex flex-col items-start">
<Link @variant="quiet" @href="https://www.crowdstrike.com/about-crowdstrike/">CrowdStrike's Story</Link>
<Link @variant="quiet" @href="http://www.crowdstrike.com/news/">CrowdStrike News and Releases</Link>
</div>
<div class="flex flex-col items-start">
<Link @variant="quiet" @href="https://www.crowdstrike.com/blog/category/engineering-and-technology/">CrowdStrike Engineering and Tech Blog CrowdStrike</Link>
<Link @variant="quiet" @href="#">CrowdStrike People and Culture</Link>
<Link @variant="quiet" @href="https://crowdstrike.wd5.myworkdayjobs.com/crowdstrikecareers">CrowdStrike Open Positions</Link>
</div>
</nav>

<div class="p-8 md:p-0 grid gap-4 md:grid-flow-col w-full items-center">
<ExternalLink @href="https://crowdstrike.com" class="mt-3 justify-self-start">
<img src="/logo_footer.png" alt="Visit crowdstrike.com" />
</ExternalLink>

<div class="md:justify-self-center text-body-and-labels type-xs">
<span class="px-2">Copyright &copy; 2023</span>
<span>|</span>
<ExternalLink @href="https://www.crowdstrike.com/contact-us/">Contact Us</ExternalLink>
<span>|</span>
<ExternalLink @href="https://www.crowdstrike.com/privacy-notice/">Private</ExternalLink>
<span>|</span>
<ExternalLink @href="https://www.crowdstrike.com/website-terms-of-use/">Terms of Use</ExternalLink>
<span>|</span>
<ExternalLink @href="https://www.crowdstrike.com/careers/candidate-privacy-notices/">Candidate Privacy Notices</ExternalLink>
</div>

<div class="md:justify-self-end flex gap-2 items-center">
<ExternalLink @href="https://www.youtube.com/user/CrowdStrike">
<img src="/youtube.png" alt="Visit the CrowdStrike YouTube channel" />
</ExternalLink>
<ExternalLink @href="https://www.instagram.com/crowdstrike/?hl=en">
<img src="/instagram.png" alt="Visit the CrowdStrike Instagram" />
</ExternalLink>
<ExternalLink @href="https://www.linkedin.com/company/crowdstrike">
<img src="/linkedin.png" alt="Visit the CrowdStrike LinkedIN" />
</ExternalLink>
</div>
</div>
</div>
</footer>
</template>

export default Footer;
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/vsc-ember-syntax
Submodule vsc-ember-syntax added at 55ca69
24 changes: 24 additions & 0 deletions vendor/licenses/git_submodule/vsc-ember-syntax.dep.yml
Original file line number Diff line number Diff line change
@@ -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: []

0 comments on commit a4e2bf9

Please sign in to comment.