Actionscript Getter/Setter Command for Textmate
I love TextMate.
Yay, today I’ve purchased the extraordinary TextMate and wrote my first command for it. A pain for a Ruby/Bash/AppleScript beginner like me, so it may be cumbersome and/or ugly, but it works. So let me show you what it does …
1. Variable naming
Basically I give my private properties the suffix “__”, so I can identify them easier inside the class body. Therefore I laid the regexp out this way, but feel free to change it to fit your needs.
2. Triggering the command
If you named your properties the right way (or edited the regexp) this popup window comes up, after triggering the command. You can now easily choose which variable you want to add getter/setters for. Just select and press OK and vóila …
3. The pasted snippet
the getter/setters have been automatically been generated.
4. The setup
Input: Entire Document
Output: Insert as Snippet
Activation: Choose whatever you want, personally I prefer using "get" as a Tab Trigger
Scope Selector: source.actionscript