-
Notifications
You must be signed in to change notification settings - Fork 48
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
syntax highlighting is lost after call to handlebars helper with string parameter inside script block #99
Comments
The problem is that the handlebar grammar uses the 'source.js' grammar for embedded code. That's not really correct due to the templates. The grammar that we use in VSCode doesn't handle the {{{ helper 'param'}}} and gets stuck in a rule (FYI @sheetalkamat) . It's a weakness of TextMate that it doesn't have a proper embedding story and a problem in the embedded code can ruin the colouring of the rest of the file |
Hey @aeschli, Really sorry for taking this long to get back to you! I'm not really sure what's going on here, this problem doesn't seem to manifest in Sublime Text: I'm very apprehensive about including other syntaxes as that would mean I need to maintain not only Handlebars, but potentially several others. With this particular usage (as in injecting a value into a script, not just as an HTML template), you could be using Handlebars in any other language – not just JS –, so I would need to potentially include anything from PHP or ASP, etc. I might be totally misunderstanding what this is about though, so in that case please explain! 😺 |
Hi @daaain, the difference to Sublime is that Sublime uses a different JavaScript grammar than us. I understand that you'd prefer to keep the grammar minimal and reuse grammars from other languages, but given that handlebar templates can be everywhere, you still might want to look into doing the colouring of embedded code yourself. That could be very minimal with highlighting of keywords, comments and strings. |
From @Jusys on October 9, 2017 21:38
Steps to Reproduce:
If call to helper is without string parameter, everything is ok:
Reproduces without extensions: I have no extensions installed
Copied from original issue: microsoft/vscode#35934
The text was updated successfully, but these errors were encountered: