Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 49383

Summary: templates in the Ant editor
Product: [Eclipse Project] Platform Reporter: John-Mason P. Shackelford <jpshack>
Component: AntAssignee: John-Mason P. Shackelford <jpshack>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: danrubel, Darin_Swanson
Version: 3.0   
Target Milestone: 3.0 M8   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 11020    
Bug Blocks: 49384    
Attachments:
Description Flags
getting started on template support none

Description John-Mason P. Shackelford CLA 2003-12-29 11:10:34 EST
Add support for templates such as exist in JDT. Create a number of defaults for
fileheader, project, target with description, target without description,
macrodef, fileset, etc.
Comment 1 John-Mason P. Shackelford CLA 2004-03-11 14:21:01 EST
As I see it, this task breaks down into the following items:

1. Add an extension point for adding templates to the ant editor. (Unless Tom is
adding a generic extension point that we can use.)

2. Add a preference page for defining templates. 

3. Add the available templates into Content Assist.

4. Insert the templates into the editor itself, w/ linking support, etc.

I'd suggest we proceed by tackling 3. & 4. so that we can get something in
before the feature freeze. We may need to do 1. on the way--but that part is no
brainer. I wouldn't think 3. would involve much effort either, though I am still
fairly green. Tom's patch in bug 11020 should give us enough example code to get
moving on 4.

Comment 2 John-Mason P. Shackelford CLA 2004-03-12 15:24:09 EST
5. Add a bunch of helpful templates for commonly used tasks and type.
Comment 3 John-Mason P. Shackelford CLA 2004-03-13 12:05:35 EST
Created attachment 8552 [details]
getting started on template support

This patch adds a single template to the code completion: <fileset>. The
proposal appears to work only under the <project> element and not inside
<target>s.
Comment 4 John-Mason P. Shackelford CLA 2004-03-13 16:48:58 EST
Ant's content assist has the notion of modes-- task mode, attribute mode, etc.
We could use several code template contexts to correspond to these modes. I
suspect that most templates will be relevant to task mode, however we'll also
have templates for the project, targets, as well as arbitrary snippets (for
which I don't actually have a use case at the moment, but since users will be
able to add templates via the preferences this is probably a good idea).
Comment 5 Darin Swanson CLA 2004-03-14 23:12:49 EST
I have added the extension point and the support for determining the templates.
See AntTemplates.

One template has been added via the extension point in Ant ui: fileset.
I added the template icon for the template proposals.
Changes to AntTemplates, AntEditorCompletionProcessor, AntUIImages, 
IAntUIConstants.
I added the antTemplates.exsd schema file, changes to plugin.xml and 
plugin.properties.

Note that the additional proposal info is not working?
Comment 6 Darin Swanson CLA 2004-03-16 00:22:57 EST
I added a template for <property name="" value=""/>
Comment 7 John-Mason P. Shackelford CLA 2004-03-16 14:15:31 EST
Per our conversation I assume we'll do nothing more on this until M9 when we 
address the formatting templates as they are inserted and adding templates for 
common tasks and types.
Comment 8 Darin Swanson CLA 2004-03-16 14:20:58 EST
I will likely detail the remaing enhancements/problems in new bug reports so we 
can outline in this bug report the support that we do have.
Comment 9 John-Mason P. Shackelford CLA 2004-03-19 08:30:57 EST
I have added the following for the remaining work on the template support.
I will address these in M9.

bug 55355 investigate new template extension point for ant editor  
bug 55356 templates should be formatted on insert  
bug 55357 templates do not appear in content assist when expected  
bug 55358 Create templates for commonly used tasks and types. 
Comment 10 Darin Swanson CLA 2004-03-19 17:57:14 EST
With bug 55355, this bug really becomes obsolete.
I created bug 55435 for the preference page enhancement.

We will run with the new set of bug reports.
Comment 11 Darin Swanson CLA 2004-03-19 17:58:27 EST
(Kindof verified).