I was writing a quick answer to a reader concerning how to use jEdit to browse ActionScript code in a tree view, when I suddenly realized the current solution wasn't good enough. But after banging around on some source code this evening (and with the help of Ali Rantakari), I think I've managed to make an AS 1, 2 or 3 code browser that rivals a few I've seen on other platforms. Isn't open source wonderful?
Warning: This article goes into some depth regarding customizing jEdit, Ctags and the Sidekick plugin. If you want to be spared the details, you can always skip to the end and just reap the rewards: A shiny new code browser custom-made for ActionScript!
A little background
Making the editor yours
JEdit's optional CTagsSidekick plugin can be used to parse any language supported by the Exuberant Ctags parser. The plugin uses Ctags to parse through the current buffer and present the defined tags it finds in the SideKick tree.
Unfortunately, ActionScript is not one of the 34 languages supported "out of the box" by Ctags, so we have to do a little hacking to get things to work the way we want. Thanks to the work of a few pioneers, however, it's easy enough to introduce ActionScript parsing to Ctags, and therefore, to jEdit itself.
Much of the credit for this hack goes to Sean Voisen, who did a lot of work three years ago to bring peace between the warring jEdit and ActionScript development. Unfortunately, I was a day late getting to Sean's site, and he wiped it clean of all things jEdit last month (d'oh!). Fortunately, Richard Leider's site still contains mention of Sean's work, and also provides a copy of a language 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 binary available below.)
To get everything I wanted out of the Sidekick panel, I had to gather a couple of things from elsewhere on the Web, as well as make a few files of my own:
1. Start with Shlomy Reinstein's CtagsSidekick plugin for jEdit. This can be installed through the editor's Plugin Manager and docked on either side of the main edit window. To provide its power, it relies on the Exuberant CTags command-line tool, so of course we'll also need…
2. The latest "Source only distribution" of Exuberant Ctags. (Note: If the idea of compiling C source files makes you queasy, I've provided a link to a precompiled version of the modified file in Step 5B below.)
3. Our edited actionscript.c file (Again, if you plan to use the precompiled version, you can skip this file, too).
4. Our "easy-on-the-eyes" replacement icons for the CtagsSidekick plugin (This is optional. You may be perfectly happy with the default CtagsSidekick icon set. Personally, it hurts my ears.)
Read more
http://www.turdhead.com/2007/10/09/almost-perfect-actionscript-code-browsing-with-jedits-sidekick-panel/