Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

support embedded hbs #710

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

NullVoxPopuli
Copy link

Caveat: I'm not sure how to test this. I'm new to Atom

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Try to support embedded hbs via template literals, as is demonstrated via:
https://hljs-glimmer.nullvoxpopuli.com/?sample=jsWithHbs

(this is used everywhere in testing, too)

Alternate Designs

?

Benefits

Handlebars developers (and consequently ember developers, even though ember doesn't use handlebars), will get syntax highlighting on hbs template strings

Possible Drawbacks

people get color?

Applicable Issues

@icecream17
Copy link
Contributor

here's an example of adding a test:
https://github.com/atom/language-javascript/pull/686/files?authenticity_token=4VJRqGanlAImauIU7k1e3f1jPOVCh1%2Bx9NV80qiIWtduhIIrWuo6sUqt240IVZN3JgJxVVqVbULNJgrKzO%2FAhA%3D%3D&file-filters%5B%5D=.coffee#diff-ad1df1a6fb1e184c8294a94418c0dcba44b84968ae60b819ab60358361d4c8c1R633-R641

basically grammar.tokenizeLine whatever you want and then check if the tokens and scopes match

Copy link
Contributor

@icecream17 icecream17 left a comment

Choose a reason for hiding this comment

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

Copied? (Btw, I added tests in a pr: NullVoxPopuli#1)

grammars/javascript.cson Outdated Show resolved Hide resolved
icecream17 and others added 2 commits December 14, 2021 10:04
assuming hbs template scope
Co-authored-by: steven nguyen <nguyeste008@students.garlandisd.net>
@NullVoxPopuli
Copy link
Author

Thank you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants