[wingide-users] Comment block template

Wingware Support support at wingware.com
Wed Mar 20 11:46:35 EDT 2013


Bryan Newman wrote:
>
> Is there a way to set up a script or a template to add a comment 
> template at the current cursor?
>

Yes, using the Snippets tool in Wing IDE Pro.  Docs are at 
http://wingware.com/doc/edit/snippets

Something like the following work work for the text you gave:

|m|"""

%(description|string)s

Date:

%(date|date)s

Author:

%(author|string|${USER})s

Input Parameters:

%(args)s

Returns:

%(return)s

Modifications:

|!|

"""

If you wanted to get fancier and automatically parse out args and return 
value you could instead use Wing's scripting API to write up scripts 
that can get analysis information for the current context and place the 
snippet with some of the input parameters and return value part already 
filled in as well.  You would use CAPIStaticAnalysis to get analysis 
information and then PasteSnippet() on the CAPIEditor.  Docs for this 
are at http://wingware.com/doc/scripting

Thanks,

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com


More information about the wingide-users mailing list