Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handlebars language (for glimmer) #8779

Closed
wants to merge 1 commit into from

Conversation

c0rydoras
Copy link
Contributor

Add Handlebars Language (glimmer templates)

This adds support for glimmer hbs templates which are commonly used in ember.js.

It uses the grammar and queries from https://github.com/alexlafroscia/tree-sitter-glimmer

glimmer templates

image
image

nonglimmer templates

image

@kirawi kirawi added the A-language-support Area: Support for programming/text languages label Nov 16, 2023
name = "handlebars"
injection-regex = "hbs"
roots = ["package.json"]
file-types = ["hbs"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.hbs is just the handlebars extension, no? Templating languages are tricky to recognize because they can template any other language. AFAIK handlebars isn't HTML-specific so using an HTML-specific parser for all .hbs will give the wrong highlights for some files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes .hbs is just handlebars, this grammar is made for ember.js's adaptation of handlebars (glimmer) templates which has some additional things e.g. components (tags starting with an uppercase letter), yield. html highlighting etc.

@c0rydoras
Copy link
Contributor Author

superseeded by #9902

@c0rydoras c0rydoras closed this Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants