Skip to content

Expose template content as raw_text #13

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

mogstad
Copy link
Contributor

@mogstad mogstad commented Mar 17, 2025

To add gts syntax highlighting to Zed, I wasn't able to use injection.include-children to inject hbs grammar into the template tag. The pattern of exposing it as raw_text matches Vue and Svelte.

To add gts syntax highlighting to Zed, I wasn't able to use
`injection.include-children` to inject hbs grammar into the template
tag. The pattern of exposing it as raw_text matches Vue and Svelte.
@@ -47,6 +47,9 @@ noJSX(JavaScript);
*/
module.exports = grammar(JavaScript, {
name: "glimmer_javascript",

externals: ($, previous) => previous.concat([$.raw_text]),
Copy link
Member

Choose a reason for hiding this comment

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

how does externals work? I should have asked this on the other PR -- but I mostly trust the tests to keep anything from regressing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I misunderstood what it meant! I think it means it gets that variable from an external parser. I based this on Vue and Svelte, and I’m pretty sure they have external parsers. Will create PRs to remove it!

@NullVoxPopuli NullVoxPopuli merged commit 5f46117 into ember-tooling:main Mar 17, 2025
7 checks passed
@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label Mar 17, 2025
@github-actions github-actions bot mentioned this pull request Mar 17, 2025
@mogstad mogstad deleted the push-npwupmwyrwkk branch March 20, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants