Some of the color schemes (like Monokai) will highlight function arguments. However, when an anonymous function is used as an argument, the anonymous function’s argument will not be highlighted unless there is a space between the function keyword and the parentheses. Example:
// argument el should be highlighted but it isn't
Array.prototype.slice.call(arguments).forEach(function(el) {
//stuff
});
// argument el is highlighted
// notice the space between function and (el)
Array.prototype.slice.call(arguments).forEach(function (el) {
//stuff
});
The bug seems to be in the regex to match regular functions. In JavaScript.tmLanguage line 260, you have:
<string>\b(function)\s+([a-zA-Z_$]\w*)?\s*(\()(.*?)(\))</string>
but it should be
<string>\b(function)\s*([a-zA-Z_$]\w*)?\s*(\()(.*?)(\))</string>
Hope this helps someone!