When I do this with JavaScript highlighting:
new function() { let x = 10; console.log(x); }
The keyword function
is not highlighted because new
expects an identifier. I’ve looked at JavaScript.sublime-syntax in the JavaScript package but I am not sure of how to solve this well or without experimentation. So I wanted to know if there is any quick tweak I can do to allow closures in construction using new
if that is how I can have function
be highlighted in the above example. Any ideas?
I know I may be suggested against constructing with closures in the first place, but I prefer this way and besides, this is a flaw in the syntax highlighting as this syntax is clearly allowed and function
is not treated as an identifier, unlike the syntax YAML file specifying: {{identifier}}
.
Thank you, monad.