Handlebars
Handlebars copied to clipboard
$(function {}) syntax highlighting failed
Look at the gif.
syntax highlighting failed when "$(function () {" entered. syntax highlighting good when "$(function () {" commented
Hey,
Sorry for the slow response, I got as far as reproducing the issue on master, but haven't fixed it yet.
It seems the syntax highlighter gets very confused by the Javascript curly braces, you can make it do all sorts of weird things...
I'm not really sure why is this happening, but if you have time have a look and play with the Javascript script tag (https://github.com/daaain/Handlebars/blob/master/grammars/Handlebars.json#L148) and Handlebars type script tag (https://github.com/daaain/Handlebars/blob/master/grammars/Handlebars.json#L696) to see if detection can be improved.
There are a couple of files to test with, none of the currently supported features should break: https://github.com/daaain/Handlebars/tree/master/test
That's ok. Microsoft fixed it.
I tested on VSCode insider v1.35, issue has been fixed.
Hmm, that's really odd as their commit only pulled in the latest changes from this repo which only had an unrelated fix: https://github.com/microsoft/vscode/commit/45db52ba6bd211cecd03897caee0531350071721#diff-d15d8c6b4b1f6cdcdb925a0f62644dedR9
It's definitely still an issue in Sublime Text though where I tested, but since the way Javascript is handled is by using the existing language grammar definition in the editor I guess there can be inconsistencies.
Anyway, I think it's best to keep the issue open for now just to keep an eye on it.