[TxMt] AS3 Commenting Style

Simon Gregory simon at helvector.org
Thu May 22 18:35:42 UTC 2008


I've been playing around with how the asdoc blocks work recently, so  
this refers to the latest revision of the ActionScript 3 bundle.

Firstly the bundle recognises a distinction between documentation  
blocks and comment blocks. Multiline comment blocks can be triggered  
using the TM convention cmd-/ and will give you:

/*
A multiline comment, without your tab, but no *
*/

So you could look at duplicating/editing the 'Documentation Newline'  
snippet to get what you want. It would need re-scoping to  
comment.block.actionscript.3 and it's trailing whitespace removed.

If you're after changing a documentation block then the command  
'Documentation Block' is tab triggered by doc. It's has dynamic output  
based on the local scope. If you're in the line above a class  
definition you get a class asdoc block, elsewhere a standard @private  
block. They look like this,

/**
  * 	Blah, blah.
  */

and are following the conventions here: <http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-ASDoc 
 > (Note the second star in the first line, without it the asdoc tool  
won't parse the block).

I've also added the shell variable TM_ASDOC_GENERATION which, when  
set, will automatically insert asdoc blocks when using certain  
declaration snippets and commands.  So if you're dedicated to your  
cause and want to use auto generation you'll have to track these down  
and change them too.

Cheers,
Simon

On 22 May 2008, at 18:22, Gaby Vanhegan wrote:

> I recall this being discussed before but searching for the phrase  
> "comments" on Google matches pretty much every blog out there, so no  
> joy.
>
> I wish to modify the commenting style in the AS3 bundle from this:
>
> /*
> *	Comment in here, everything left aligned, huge tab in there!
> */
>
> To this:
>
> /*
> * Comment in here, one space before, not a tab after
> * Final line leaves all *'s nicely lined up
> */
>
> I have tried searching through the AS3 bundle for anything relating  
> to comments but I must be looking in the wrong places.  It'll be  
> some tiny tweak to a regex, I hope.  Can anyone point me in the  
> right direction?
>
> Many thanks!
>
> Gaby
>
> -- 
> Uganda Maximum - Enemy of the English Thrust
> http://www.playr.co.uk/
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list