Bug 73291 - [templates] Formatting code auto complete/generate template variables
Summary: [templates] Formatting code auto complete/generate template variables
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-05 04:16 EDT by pRasanna CLA
Modified: 2007-06-22 10:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pRasanna CLA 2004-09-05 04:16:11 EDT
It would be nice if there are options to format the auto generated variables 
such as 
- date format - default format of 'Mon d, yyyy' shall be changed into 'Mon.dd. 
yyyy'

- 'method_arguments' variable shall be customized to include the exact 
declaration statement like 'int from, int to' rather than 'from, to'. This would 
be of much use in logging.
Comment 1 Dirk Baeumer CLA 2004-09-07 13:11:13 EDT
Can you please provide a code example ?
Comment 2 pRasanna CLA 2004-09-07 13:26:19 EDT
1.

/**
 * @author pRasanna
 * @date   ${date}
 * @since  Foo 1.0; ${date}
 */

The above code generation template pattern results in the following comment
being generated for java classes.
/**
 * 
 * @author pRasanna
 * @date   Sep 7, 2004
 * @since  Foo 1.0; Sep 7, 2004
 */

But which we actually edit as following to go with the coding standards of our 
concern.

/**
 * 
 * @author pRasanna
 * @date   Sep.07.2004
 * @since  Foo 1.0; Sep.07.2004
 */


2.

final String LogSourceMethod = "${enclosing_method}
(${enclosing_method_arguments})";

An code completion template(Java Editor template) with a pattern as above 
results as following for a method "public void doPost(HttpServletRequest 
request, HttpServletResponse response)" 

final String LogSourceMethod = "doPost(request, response)";

which we actually would want as
final String LogSourceMethod = "doPost(HttpServletRequest request, 
HttpServletResponse response)";

or 

final String LogSourceMethod = "doPost(HttpServletRequest, HttpServletResponse)
";

These are just few of the scenarios wherein a particular organization standards 
can be incorporated for the auto generated/auto completed code too.

Hope this suffice.

tx
pRasanna

Comment 3 Dani Megert CLA 2004-09-08 06:31:31 EDT
The date is taken from your regional settings of your OS. There are currently no
plans to further configure this. You can set your computer to match your
concern's coding standard.
Comment 4 Dani Megert CLA 2007-06-22 09:59:21 EDT
Get rid of deprecated state.