Change the source code templates for public and private methods

The definition of the template string for public and private methods are located in the class EtTools. The following example shows how to create method template which follow a more structured way (which e.g. is common in the SST code):

| aStream |
aStream := WriteStream on: String new.
  nextPutAll: 'messagePattern' ; cr ;
  tab ; nextPutAll: '"'; cr;
  tab ; nextPutAll: 'ACTION' ; cr ;
  tab ; tab ; nextPutAll: 'description what the method does' ; cr ;
  cr ;
  tab ; nextPutAll: 'PARAMETERS' ; cr ;
  tab ; tab ; nextPutAll: 'pName: name of type' ; cr ;
  cr ;
  tab ; nextPutAll: 'RETURN VALUE' ; cr ;
  tab ; tab ; nextPutAll: 'type of return value' ; cr ;
  tab ; nextPutAll: '"'; cr;

EtTools publicTemplate: aStream contents

If you want to change the template for private methods simply execute:

EtTools privateTemplate: aStream contents
This entry was posted in Smalltalk. Bookmark the permalink.