Skip to content

Replaced Template Tag with Glimmer TS. Added Glimmer JS. - #9559

Closed
ijlee2 wants to merge 2 commits into
sublimehq:masterfrom
ijlee2:add-gjs-gts
Closed

ijlee2 wants to merge 2 commits into
sublimehq:masterfrom
ijlee2:add-gjs-gts

Conversation

@ijlee2

@ijlee2 ijlee2 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
  • I'm the package's author and/or maintainer.
  • I have read the docs.
  • I have tagged a release with a semver version number.
  • My package repo has a description and a README describing what it's for and how to use it.
  • My package doesn't add context menu entries. *
  • My package doesn't add key bindings. **
  • Any commands are available via the command palette.
  • Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
  • If my package is a syntax it doesn't also add a color scheme. ***
  • I use .gitattributes to exclude files from the package: images, test files, sublime-project/workspace.

My package helps Ember apps and addons use the <template> tag to write components, routes, and test files. Such files have the file extension .gjs (JavaScript) or .gts (TypeScript).

There are no packages like it in Package Control.

Background

The package Template Tag currently handles both *.gjs and *.gts files (see #9123). While developing an LSP (Language Server Protocol) for such files, I learned that it's better (possibly necessary) to have separate packages so that the underlying dependency @glint/tsserver-plugin knows which code to run based on the file extension.

sublime-syntax-definition-template-tag contains both syntax definitions in the main branch, and uses the glimmer-js and glimmer-ts branches (each branch uses .gitattributes to exclude the unnecessary definition) to provide two packages from one repo.

@github-actions

Copy link
Copy Markdown
Contributor

This PR removes Template Tag and adds GJS and GTS.

Review for GJS 2026.09.10.07.17.42

No failures, no warnings. 👍

About the entry here:

  • Tip: GJS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

Review for GTS 2026.09.10.07.17.42

No failures, no warnings. 👍

About the entry here:

  • Tip: GTS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

@rchl

rchl commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

I think this should be a single package providing both syntaxes as those seem to be basically just variants of the same syntax - https://guides.emberjs.com/v6.8.0/components/template-tag-format/

And the name should reflect the name of the language and not just be the file extension.

Also, are there existing packages for this language already? There seem to be some old ones that reference Ember. But those probably don't achieve your goal of having separate scope for js/ts version.

@ijlee2

ijlee2 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi, @rchl. Thanks for your help with review and providing feedback.

While creating LSP-ember@0.1.0 with Claude Code and debugging issues found through local testing, I thought that it is necessary to have two separate packages. It didn't help that I was unfamiliar with the implementations of @glint/ember-tsc and @glint/tsserver-plugin, the dependencies that LSP-ember uses. Had we continued with the 2-package approach, the human-readable names would be Glimmer JS and Glimmer TS.

I tried your suggestion that a single package could work (I'd definitely favor this, as it reduces maintenance cost also on my side). It seemed like, if we update the configuration files language-ids.sublime-settings, LSP-ember.sublime-settings, and typescript-plugins.json correctly, then LSP works in both *.gjs and *.gts files, while Glint returns messages from TypeScript in *.gts files only.

Here are the pull requests for going with 1 package:

This would mean:

@ijlee2

ijlee2 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Also, are there existing packages for this language already? There seem to be some old ones that reference Ember. But those probably don't achieve your goal of having separate scope for js/ts version.

Code syntax and file type that Ember uses have changed over the years; it is more closely aligned to native JavaScript and TypeScript. To help write code in Sublime Text, we'd only need to support files with extensions *.{gjs,gts} and *.hbs (the latter can still be found in older projects).

Ember is currently on version 7.2. I'd say that many of these packages might have been useful up till 3.15, and should not be recommended and used anymore. (Version 3.16 introduced the "Octane edition," where the project structure and code syntax are close to what one may see nowadays.)

  • EmberScript: Have never heard of the language called EmberScript. Package includes the label emberjs and was updated 12 years ago, so I imagine that it was a variation in file extension during Ember 0.x - 1.x.
  • Ember​Tool​Box: Updated 10 years ago. Seems to be created for LinkedIn developers.
  • Ember.​js Snippets: Updated 7 years ago. Shows code patterns from Ember 1.x.
  • Ember Syntax: Updated 9 years ago. Repo no longer exists.
  • Simple Ember.​js Navigator: Updated 14 years ago. Supports Sublime Text 2.
  • Ember CLI Snippets: Updated 11 years ago. Shows code patterns from Ember 2.x.
  • Ember Single-File Component Syntax. Updated 9 years ago. Seems to be created for an "Ember addon" that never reached a stable release and wasn't widely adopted.
  • Sublime​Linter-contrib-ember-template. Updated 2 years ago. ember-template-lint has been deprecated and is replaced by eslint-plugin-ember@v13.
  • Ember Template Component Split View: Updated 10 years ago. Repo no longer exists.

In short, there are no other packages that provide syntax highlighting for *.{gjs,gts} files. Similarly, there are currently no packages that provide LSP features for *.{gjs,gts} files, which is why I created LSP-ember. What's still missing are (modern) code snippets.

For *.{js,ts} files, Ember developers can rely on existing packages (e.g. LSP-typescript). For *.hbs files (no longer recommended in modern projects), the package Handlebars provides syntax highlighting.

I hope that this provides you additional information, in case you want to remove the outdated/unmaintained packages.

@jwortmann

Copy link
Copy Markdown
Contributor

Had we continued with the 2-package approach, the human-readable names would be Glimmer JS and Glimmer TS.

I would probably rename the existing "Template Tag" package to "Glimmer" (use "previous_names": ["Template Tag"] in this PR), so that it is easier to find ("Template Tag" seems like a pretty generic name that would also apply to various other languages), but still provide two separate syntaxes for Glimmer JS and Glimmer TS in that package. They seem to be derived from JavaScript and TypeScript, respectively, so the syntaxes should probably look somewhat like this:

%YAML 1.2
---
name: Glimmer JS
scope: source.gjs
version: 2

extends:
  - Packages/JavaScript/JavaScript.sublime-syntax

file_extensions:
  - gjs

contexts:
# ...
%YAML 1.2
---
name: Glimmer TS
scope: source.gts
version: 2

extends:
  - Packages/JavaScript/TypeScript.sublime-syntax

file_extensions:
  - gts

contexts:
# ...

Then you could use this selector for LSP-ember: "selector": "source.gjs | source.gts"

Disclaimer: I have zero experience with Ember/Glimmer/gjs/gts, so take this suggestion with a grain of salt.

By the way, the language-ids.sublime-settings file for LSP doesn't exist anymore, but if the language server requires special language IDs which are not directly derived from the base scope of the syntax(es), feel free to open an issue or PR in the LSP repository, and we can add the proper language IDs there.

@ijlee2 ijlee2 changed the title Replaced Template Tag with GTS. Added GJS. Replaced Template Tag with Glimmer TS. Added Glimmer JS. Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR removes Template Tag and adds Glimmer JS and Glimmer TS.

Review for Glimmer JS 2026.09.14.08.07.45

No failures, no warnings. 👍

About the entry here:

  • Tip: Glimmer JS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

Review for Glimmer TS 2026.09.14.08.07.45

No failures, no warnings. 👍

About the entry here:

  • Tip: Glimmer TS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

@ijlee2

ijlee2 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi, @jwortmann. I appreciate the additional review and your feedback.

Your understanding of *.gjs and *.gts files is right. We can think of them as *.js and *.ts with one or more <template> tag(s), so their syntax definitions would be more correct if they extend JavaScript.sublime-syntax and TypeScript.sublime-syntax, respectively. I've implemented your suggestion in sublime-syntax-definition-template-tag#21.

feel free to open an issue or PR in the LSP repository, and we can add the proper language IDs there.

In LSP-ember#6, I kept the language-ids.sublime-settings file to unblock the merge. I can help add the language IDs upstream. Can you clarify for me which repo you were referring to by "the LSP repository" (and possibly which file to edit)? I'm not too familiar with the repos in the sublimehq organization.


@rchl and @jwortmann: I propose that we go with the two-package approach, since it helps us capture what *.gjs and *.gts files are more accurately, and would help us make additional changes (to one or both packages) more easily. Would this be okay with you?

@github-actions

Copy link
Copy Markdown
Contributor

This PR removes Template Tag and adds Glimmer JS and Glimmer TS.

Review for Glimmer JS 2026.09.14.08.07.45

No failures, no warnings. 👍

About the entry here:

  • Tip: Glimmer JS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

Review for Glimmer TS 2026.09.14.08.07.45

No failures, no warnings. 👍

About the entry here:

  • Tip: Glimmer TS only defines branch-based releases. Consider adding at least one tags: true release so Package Control can install stable tagged versions.

@jwortmann

Copy link
Copy Markdown
Contributor

Can you clarify for me which repo you were referring to by "the LSP repository" (and possibly which file to edit)?

If you want to do a PR, you need to modify this file: https://github.com/sublimelsp/LSP/blob/a06ad894afada7b262804ec2ed7d1957a1c5dcc4/plugin/core/constants.py#L280-L322


The decision is up to you, but I'd highly recommend to keep both syntaxes inside a single package and not split it into separate packages. GJS and GTS seem closely related to each other, and it is absolutely fine to have multiple related syntaxes in a single package. A split would just make it annoying for users that they have to install two separate packages.

Also, if you have .tmPreferences configuration files, for example to enable comment toggling (example), which should apply for both syntaxes in the same way, then you could just use source.gjs | source.gts as the scope selector. Splitting into separate packages would mean that you'd need to duplicate such files.

@ijlee2

ijlee2 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I'd highly recommend to keep both syntaxes inside a single package and not split it into separate packages.

Ah, my bad. I had misunderstood @rchl's suggestion, "single package providing both syntaxes," as a single .sublime-syntax file.

The sublime-syntax-definition-template-tag repo now continues to use tags for Package Control, but provides 2 .sublime-syntax files (one for .gjs and the other for .gts).


Going back to:

I would probably rename the existing "Template Tag" package to "Glimmer"

I agree that "Template Tag" sounds generic and might later be used differently in another context (another frontend framework). I'd still use it for the package name, because the term "Template Tag" is commonly used in Ember to refer to *.{gjs,gts} files; for example, in https://guides.emberjs.com/release/components/template-tag-format.

For additional info: The terms "Glimmer JS" and "Glimmer TS" might appear in the context of syntax highlighting and LSP, but aren't used colloquially to my knowledge. The term "Glimmer" is overloaded in Ember, so I'd avoid this for the package name. It is usually associated with the "Glimmer component," may sometimes refer to the packages @glimmer/component and @glimmer/tracking, or, on occasions, the Glimmer project (an experiment to help modernize Ember).

Assuming we keep the package name, we can close this PR. (Sorry for the confusions, and thanks again for your feedbacks.)

@ijlee2 ijlee2 changed the title Replaced Template Tag with Glimmer TS. Added Glimmer JS. Added description to Template Tag Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes Template Tag.

Review for Template Tag main-9bf20c8-2026.09.14.15.10.57

No failures, no warnings. 👍

@ijlee2 ijlee2 changed the title Added description to Template Tag Replaced Template Tag with Glimmer TS. Added Glimmer JS. Sep 14, 2026
@ijlee2

ijlee2 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on adding language IDs upstream: sublimelsp/LSP#3028

@ijlee2

ijlee2 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Both sublimelsp/LSP#3028 and sublimelsp/repository#173 have been merged, so I'll close this pull request. The package name Template Tag is assumed to remain the same.

@ijlee2 ijlee2 closed this Sep 14, 2026
@ijlee2
ijlee2 deleted the add-gjs-gts branch September 14, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants