Bug 246459 - [code templates] Allow different code templates profiles like formatters & cleanups
Summary: [code templates] Allow different code templates profiles like formatters & cl...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-06 07:07 EDT by Claudio Nieder CLA
Modified: 2021-03-14 00:23 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Nieder CLA 2008-09-06 07:07:37 EDT
Build ID: I20080617-2000

Steps To Reproduce:
In Preferences->Java->Code Style can have different Formatter and Code Style Profiles but only one set of Code Templates.


More information:
It would be nice to be able to switch between code templates as easily as between as between formatter/clean up actions. Maybe it would even make sense to couple these three under a common profile setting, as e.g. if you select a certain code style then you need the template which matches it.
Comment 1 Dani Megert CLA 2008-09-06 07:58:15 EDT
Makes sense.

You probably know this but just in case: you can assign project specific code templates and share them.
Comment 2 Christoph Laeubrich CLA 2021-03-14 00:23:27 EST
(In reply to Dani Megert from comment #1)
> You probably know this but just in case: you can assign project specific
> code templates and share them.

I also find that this would be useful. The problem with project specific assignments are that this requires duplicate configuration and if you create a new one it also has to be taken into consideration.

What has come into my mind would be to allow to configure a project pattern for a profile that makes it selected on match.

For example this could be something like: 

org.eclipse.* --> "Eclipse built in"
org.apache.* --> "Apache Code Format"
* --> "Java Defaults"

as mentioned by Claudio it would be good if this could be configured on an upper level, so it includes Templates, Cleanup Actions and Code format (the example only shows code format).

This would be incredible useful if one needs to manage different projects in a workspace with different rules.