[TxMt] Javascript syntax enhancement

thomas Aylott thomas.42 at gmail.com
Tue May 16 23:20:27 UTC 2006


I have 1 up on that!

Check out my collection of crazy JavaScript wrappers. Including  
modified versions of Justin Palmer's stuff.
http://textmate.svn.subtlegradient.com/Bundles/Javascript% 
20Extras.tmbundle/

I made a pretty slick pref for the function popup/window.

For best effect use one of my Brilliance themes to have proper fancy  
hilighting and whatnot.
http://textmate.svn.subtlegradient.com/Themes/

Checkout what the prototype.js file looks like in my Javascript +  
Prototype Bracketed language syntax.

I also have code completion for a lot of prototype stuff (just the  
esc to rotate through, not a slick dropdown or anything). Planning on  
adding more, whenever i have to work in Js for a while i guess i'll  
do it.

On May 12, 2006, at 2:22 PM, Andrew Dupont wrote:

> Justin Palmer's Vibrant Ink bundle [1] includes a small syntax  
> addon for this sort of construct.  With his blessing, I've made  
> tentative plans to move some of this into the main JavaScript  
> bundle.  Someday.  Meanwhile, you can use his.
>
> [1] http://encytemedia.com/blog/articles/2006/01/03/textmate- 
> vibrant-ink-theme-and-prototype-bundle
>
> Cheers,
> Andrew Dupont
> <http://andrewdupont.net>
>
> On May 12, 2006, at 11:39 AM, Aparajita Fishman wrote:
>
>> Hi,
>>
>> I would like to suggest the following enhancement to the  
>> Javascript syntax:
>>
>> {    name = 'meta.function.js';
>>     comment = 'match stuff like: foobar: function() { … }';
>>     match = '^\s*\b([a-zA-Z_?\.$]+\w*):\s+\b(function)?\s*\((.*?)\)';
>>     captures =
>>     {    1 = { name = 'entity.name.function.js'; };
>>         2 = { name = 'storage.type.function.js'; };
>>         3 = { name = 'variable.parameter.function.js'; };
>>     };
>> },
>>
>> Since the common style in a lot of Javascript libraries (like  
>> Prototype/scriptaculous) is to define functions like this:
>>
>> var Enumerable = {
>>    each: function(iterator) {
>>        // body
>>    },
>>
>>    all: function(iterator) {
>>        // body
>>    }
>> }
>>
>> The above rule correctly highlights these definitions and also  
>> includes their names in the function popup.
>>
>> Regards,
>>    Aparajita

thomas Aylott—subtleGradient—oblivious at subtleGradient.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060516/a45b5ddf/attachment.html>


More information about the textmate mailing list