ActionScript 3 Support for jEdit’s SideKick Plugin Through Exuberant Ctags
Posted on October 9, 2007
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:
- Package names were not properly catched – only the first level was shown (e.g. “org” instead of “org.hasseg.thingamabob“)
- Todo and note names were not properly catched – it just showed “todo” or “note” instead of what comes after
- My “todo:” notes were not catched – it only supported uppercase (i.e. “TODO:“)
- Some attribute keywords (override, final, internal etc…) were not allowed on classes, functions/methods and properties, so I was missing some of these in my SideKick listings
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
*/
Comments
5 Responses to “ActionScript 3 Support for jEdit’s SideKick Plugin Through Exuberant Ctags”
[...] post by Hasse G and software by Elliott [...]
[...] 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 [...]
I think the next stop may be real code competion… ;)
–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/