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

$(function {}) syntax highlighting failed #103

Open
Cow258 opened this issue May 7, 2019 · 4 comments
Open

$(function {}) syntax highlighting failed #103

Cow258 opened this issue May 7, 2019 · 4 comments

Comments

@Cow258
Copy link

Cow258 commented May 7, 2019

2019-05-07 12 11 19

Look at the gif.

syntax highlighting failed when "$(function () {" entered.
syntax highlighting good when "$(function () {" commented

@daaain
Copy link
Owner

daaain commented May 20, 2019

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

@daaain daaain reopened this May 20, 2019
@Cow258
Copy link
Author

Cow258 commented May 20, 2019

That's ok.
Microsoft fixed it.

@Cow258
Copy link
Author

Cow258 commented May 20, 2019

I tested on VSCode insider v1.35, issue has been fixed.

@daaain
Copy link
Owner

daaain commented May 20, 2019

Hmm, that's really odd as their commit only pulled in the latest changes from this repo which only had an unrelated fix: microsoft/vscode@45db52b#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.

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

No branches or pull requests

2 participants