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
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#CodingCo...
(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@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 22 May 2008, at 14:35, Simon Gregory wrote:
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.
Does this mean that I shouldn't change the commenting style from the default as its part of the recommended ASDoc formatting scheme? All I want to do really is swap the tab after the asterisk for a space and insert another space before the asterisk.
G.
Does this mean that I shouldn't change the commenting style from the default as its part of the recommended ASDoc formatting scheme?
As long as the asdoc tool can read your comments then anything goes. I'm building the bundle to use any established conventions where possible, rather than my personal choice.
I've had some heated debates in the past over details such as the placement of a bracket or having a space before the * in a documentation line. I often find that, when I change to a different style for a couple of days, it quickly becomes the case that I can't really see what I was arguing about.
Cheers, Simon
On 26 May 2008, at 11:03, Simon Gregory wrote:
Does this mean that I shouldn't change the commenting style from the default as its part of the recommended ASDoc formatting scheme?
As long as the asdoc tool can read your comments then anything goes. I'm building the bundle to use any established conventions where possible, rather than my personal choice.
My preferred commenting style should be fine for ASDoc to parse then. The question still stands, where/how can I change the default comment formatting?
I've had some heated debates in the past over details such as the placement of a bracket or having a space before the * in a documentation line. I often find that, when I change to a different style for a couple of days, it quickly becomes the case that I can't really see what I was arguing about.
I know what you mean but my fastidious nature kicks in every time it adds that extra tab, causing me to issue a loud expletive with every added comment line...
G.
-- Being drunk is feeling sophisticated without being able to say it. http://www.playr.co.uk/
The question still stands, where/how can I change the default comment formatting?
From my original email:
So you could look at duplicating/editing the 'Documentation
Newline' snippet to get what you want.
After that I'd suggest you start out with your own snippets/commands, if you come up with anything interesting then please let me know. You may want to disable the 'Documentation Block' command.
Cheers, Simon