Hi all,
I've been working with too many prototype objects in javascript of late, and as some of you may know, they are generally declared as follows:
Sound.prototype.play = function() { ... }
All I did was took the existing function regex, and moved a couple of the captures:
{ name = 'meta.function.js'; match = '\b([a-zA-Z_?.]+\w*)\s+=\s+\b(function)?\s*((.*?))'; captures = { 1 = { name = 'entity.name.function.js'; }; 2 = { name = 'storage.type.function.js'; }; 3 = { name = 'variable.parameter.function.js'; }; }; },
It could probably be nicer, but pasting that in after the original function code (in the JS language def file) will give you properly highlighted function declarations :)
Tony Arnold http://tonyarnold.com/
“The university was great. They gave us money and facilities, but we didn’t have to produce anything. I’ve worked in the private sector. You don’t know what it’s like out there. They expect results.” -- Dr Ray Stanz, Ghostbusters
On 17/11/2005, at 3:23, Tony Arnold wrote:
[...] It could probably be nicer, but pasting that in after the original function code (in the JS language def file) will give you properly highlighted function declarations :)
I added it to the default syntax. Not entirely sure the variable to which the function is assigned, should be entity.name.function — but then again… and I'm not that familiar with JS anyway :)