Hooray [Flex Builder] Snippets!

I just came across Lee Brimelow’s tutorial for using the dynamic snippets feature of CFEclipse. His step-by-step walk though guides you through installing the CFEclipse plugin and setting it up to work with ActionScript files. He’s explaining how to do it in the context of a Flash project, but it works with any text file that you’re editing with in Eclipse.

The feature is less like the WST Snippets feature that you can install as described here and here, and more like how TextMate or TextExpander expands short text abbreviations. Really, this is a much better solution, in my opinion. The WST plugin requires that you browse for a snippet and then interact with a rather kludgy interface to enter the values you want for the variables. Also, the WST Snippets seem a little volatile. I found myself losing snippets anytime something happened to corrupt my workspace.

I’ve been using TextExpander for the last week or so, but found it somewhat limiting when it came to inserting complex snippets, like say a getter/setter block. There was no support for passing in any variables (other than what was on your clipboard), and even specifying where the cursor should end up after pasting the snippet was pretty weak since it didn’t just jump to the location but rather slowly backed up until it go where it was supposed to be.

With CFEClipse, your snippets can contain as many variables as you want, which you are prompted to insert when you paste the snippet. It even allows you to specify the default value for the variable. I’m thoroughly impressed… this is just the sort of thing I’ve been looking for.

I literally just installed this 5 minutes ago (and it only took a minute to set up), but it looks like there’s some sorta of snippet sharing feature via something called SnipEx. I’ll dig into this and share my snippets with everyone if I can. I typically use snippets for getters/setters, varying levels of comment headers, and common function declarations like the one used to override updateDiplayList.

This entry was posted in Flash and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

  1. By Hooray [Flex Builder] Snippets! (Follow-up) on April 9, 2009 at 7:01 pm

    [...] [ andy.mcintosh ] A blog about a little bit of everything, but mostly Flash & Flex Development Skip to content « Hooray Snippets! [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">