Author Topic: Editing ActionScript 3 code templates.  (Read 838 times)

__i

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Editing ActionScript 3 code templates.
« on: October 26, 2006, 05:18:59 am »
 I want change any ActionScript 3 code templates for its can support ASDoc tags and add some other info in code or comments

For example: If myMetod1 of my class is private its coment is:
/**
* myMetod1 - use it for....
* @private
* @param0
* @param1
........
*/

if it is public :

/**
* myMetod1 - use it for....
* @public
* @param0
* @param1
........
*/

@public and @private is tag that used in ASDoc.

After reading help and investigating Code Templates, I find this template for method notes:

%if genOptGenComments != "T"%
%endTemplate%

%JAVADOC_COMMENT(genOptWrapComment)%


As I understand this construction %JAVADOC_COMMENT(genOptWrapComment)% describing method comments

But I don't find how change macros "genOptWrapComment" or create new macros for my case.

help me  :)
« Last Edit: October 26, 2006, 05:22:14 am by __i »

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6354
  • Karma: +54/-5
    • View Profile
Re: Editing ActionScript 3 code templates.
« Reply #1 on: October 26, 2006, 03:38:09 pm »
You'll need to write the equivalent to the JAVADOC_COMMENT macro yourself.  The following should get you started.  You'll also need to create a custom template Parameter__Notes.

Code: [Select]
%if opNotes == ""%
%endTemplate%

/**
%WRAP_LINES(opNotes, genOptWrapComment, " * ")%
%if opScope == "Public"%
* @public
%elseIf opScope == "Private"%
* @private
%endIf%
%list="Parameter__Notes" @separator="\n", @indent=" * "%
*/

genOptWrapComment is the option for the length to wrap comment lines at. (See http://www.sparxsystems.com.au/EAUserGuide/index.html?fieldsubstitutionmacros.htm)
Simon

support@sparxsystems.com

__i

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Editing ActionScript 3 code templates.
« Reply #2 on: October 27, 2006, 01:14:55 am »
Thanks.

I thought so, but I hope find "easy" decision of this question  :)


__i

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Editing ActionScript 3 code templates.
« Reply #3 on: October 27, 2006, 08:45:18 am »
I'm find BUG in AS3 code templates:

Then  you generate code you have:

Code: [Select]

import somePackage.SomeClass1;
import somePackage.SomeClass2;

package somePackage
{


/**
.....

*/

public class MyClass extends SomeClass1

{
......

}//end MyClass

}


import section outside of package. Must be INSIDE.

Code: [Select]

package somePackage
{


import somePackage.SomeClass1;

import somePackage.SomeClass2;


/**
.....

*/

public class MyClass extends SomeClass1

{
......

}//end MyClass

}


I'm edit my templates for fix this bug, but other users ?