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

syntax highlighting is lost after call to handlebars helper with string parameter inside script block #35934

Closed
Jusys opened this issue Oct 9, 2017 · 3 comments
Assignees

Comments

@Jusys
Copy link

Jusys commented Oct 9, 2017

  • VSCode Version: 1.17.0 (issue present in both 32bit and 64bit)
  • OS Version: Windows 7 32bit, Windows 10 64bit

Steps to Reproduce:

  1. Create handlebars file;
  2. Type some html code;
  3. Create script block with function;
  4. Inside function make a call to handlebars helper with string parameter;
  5. After this syntax highlighting will be lost;

image
image

If call to helper is without string parameter, everything is ok:
image
image

Reproduces without extensions: I have no extensions installed

@aeschli
Copy link
Contributor

aeschli commented Oct 10, 2017

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
IMO the right approach is for the handlebars grammar to not include source.js, but have included simple highlighting rules for embedded code, e.g. do keyword, comment and strings highlighting.

@aeschli
Copy link
Contributor

aeschli commented Oct 10, 2017

This issue was moved to daaain/Handlebars#99

@aeschli aeschli closed this as completed Oct 10, 2017
@Jusys
Copy link
Author

Jusys commented Oct 10, 2017

aeschli: Thank you for clarification

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants