Skip to content

Better distinguish statements from expressions #1249

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

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

lassipulkkinen
Copy link
Contributor

Restricts usage of jsAll to contexts where statements are allowed. This makes it possible to add jsBlock to jsAll (fixes #1228), which is also done here.

This also splits jsRepeatParen into jsWhileParen and jsForParen, since the syntaxes are obviously very different, and restricts of to jsForParen, since that's the only place where it actually has special meaning (this is still a bit crude, as it doesn't differentiate for-of from for...). Somehow miraculously there was already a highlighting rule for jsOf, so that didn't need to be added.

Fixes incorrect highlighting of blocks as objects.
@amadeus
Copy link
Collaborator

amadeus commented Aug 2, 2022

I don't write much JS these days anymore (mostly typescript, and therefore a different plugin altogether). That said though, it looks like you put some good effort into this. I'll go ahead and merge it, although I don't really have time to test it, so I'll keep an eye out and may revert if there are issues, or if you could also keep an eye out and submit any follow ups if there are issues, that would be helpful as well!

@amadeus amadeus merged commit 67a3435 into pangloss:master Aug 2, 2022
@lassipulkkinen
Copy link
Contributor Author

lassipulkkinen commented Aug 2, 2022

Thanks! I've been using this for the past few weeks and haven't encountered any issues, although obviously I did just force-push to fix a dumb typo, so there could be more..?

I won't necessarily be writing much JS in the near future either, though, as I kind of ended up abandoning the project I was working on when I submitted this.

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

Successfully merging this pull request may close these issues.

Code incorrectly highlighted in nested braces
2 participants