hasseg.org

ActionScript 3 Support for jEdit's SideKick Plugin Through Exuberant Ctags

Filed under ActionScript 3, Flex, jEdit, Programming

Today VeryVito made a post on his blog that I had been waiting for a while now: he had just written ActionScript 3 support for Exuberant Ctags, which means proper SideKick plugin support for jEdit when editing AS3 with it. He also made nicer icons for use with the CtagsSideKick, so you should definitely check his stuff out if you use (or plan to use) jEdit for editing AS3.

However, after starting to use the SideKick plugin with the modified, AS3-supported version of Ctags while doing my work, I found a few small rough edges in the ActionScript support he had made:

Not big problems by any means, but for me these meant that SideKick wouldn't display some of the stuff in my code, and if it did, not properly, so I fixed them.

Get my modified version of the AS3-supported Ctags here:

The ctags binary (zipped) (note: compiled on a rev.B MacBook (Core 2 Duo processor) with Mac OS 10.4.10)

The source code (actionscript.c)

You should refer to VeryVito's post for more info this issue.

Update (same day as original post): Improved this a bit. Find below a complete list of changes I've made (taken from the source code):

/*
* - Added more allowed AS3 attribute keywords (override, final, internal 
*   etc...) for classes, getters & setters, variables
* - Allowed varying versions of "note" and "todo" spellings
* - Allowed points (.) in package names so that they would display the
*   whole package name instead of just the first level
* - Added interfaces matching support
* - Reformatted some name parameters:
* - Getters and setters: display either "get" or "set" in front
*   of the property name
* - Todos & notes: made the name be the text that comes after the
*   "todo" or "note" text
* - Variables: Moved the variable type after the name and separated
*   them with " : " according to ActionScript syntax
*/

5 Comments

ActionScript 3 support for jEdit’s SideKick plugin through … October 9, 2007 at 3:57 PM

[…] post by Hasse G and software by Elliott […]

Turdhead » Almost perfect: ActionScript code browsing with jEdit’s Sidekick panel October 9, 2007 at 7:38 PM

[…] definition file that I used as the basis for my own AS 1, 2 and 3 parser, actionscript.c, which Ali Rantakari immediately made even better. (Update: Ali’s changes have been incorporated into both the source code here and the precompiled […]

VeryVito October 9, 2007 at 7:46 PM

Excellent work, Ali! Thanks! Hope you don’t mind, but I’ve updated my article to reflect your changes as well – and provided a link to this post. Nice touch on the Notes and Todos, by the way – I had thrown those in as an afterthought, as I usually use the TaskList plugin to handle such things, but it is kinda nice to have ’em right there with the rest of the code tree!

I think the next stop may be real code competion… ;)

Hasse G October 9, 2007 at 9:32 PM

Hey Mike, no problem at all. I hope my changes won’t mess things up for AS2, since I only tested them with the Flex project I’m currently working on. Proper code completion would definitely be nice :)

Jingzhao Ou December 21, 2007 at 9:27 AM

It seems to me that there is no need to recompile ctag in order to add ActionScript support. You can just use the formally distributed ctags and put the following into ~/.ctags. It works just fine on my machines.

–langdef=as –langmap=as:.as –regex-as=/^[ \t][(private|public|static|protected|internal|final|override)( \t)]function[ \t]+([A-Za-z0-9_]+)[ \t](([^{])/\1 (\2/f,function,functions,methods/ –regex-as=/^[ \t][(public|static|internal|final|override)( \t)]function[ \t]+(set|get)[ \t]+([A-Za-z0-9_]+)[ \t](/\1 \2/p,property,properties/ –regex-as=/^[ \t][(private|public|static|protected|internal)( \t)]var[ \t]+([A-Za-z0-9_]+)([ \t]:[ \t]([A-Za-z0-9_]+))[ \t]/\1 : \3/v,variable,variables/ –regex-as=/^[ \t][(private|public|static|protected|internal)( \t)]const[ \t]+([A-Za-z0-9_]+)([ \t]:[ \t]([A-Za-z0-9_]+))[ \t]/\1 : \3/v,variable,variables/ –regex-as=/^[ \t][(private|public|static|dynamic|final|internal)( \t)]class[ \t]+([A-Za-z0-9_]+)[ \t]([^{])/\1 (\2)/c,class,classes/ –regex-as=/^[ \t][(private|public|static|dynamic|final|internal)( \t)]interface[ \t]+([A-Za-z0-9_]+)[ \t]([^{])/\1 (\2)/i,interface,interfaces/ –regex-as=/^[ \t][(private|public|static)( \t)]package[ \t]+([A-Za-z0-9_.]+)[ \t]/\1/p,package/ –regex-as=///[ \t](NOTE|note|Note)[ \t]:(.)/\2/i,{Notes}/ –regex-as=///[ \t](TODO|todo|ToDo|Todo)[ \t]:(.)/\2/i,{To do}/ –regex-as=/..prototype.([A-Za-z0-9 ]+)[ \t]=([ \t])function( [ \t]?)(/\1/p,prototype/

Categories