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

Bug 169599

Summary: [clean up] Move ICleanup and IFix out of UI
Product: [Eclipse Project] JDT Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2007-01-04 17:24:53 EST
The ICleanup and IFix seem to be based in the UI plugin for no obvious reason. If they were based in the JDT Core instead, they could be utilised from a batch process e.g. a cleanup on check-in on the server side.

To be honest, they would also be useful in other languages or for other types of files, too. One could imagine a CleanUp for a Python or Ruby script, or an XMLCleanUp that formatted and/or pretty-printed an XML file.

Is there any thought being given to making these available in a more generic package e.g. IDE?

At some point, it may also be nice to allow users to submit their own cleanups through an extension point. Currently, if you are adding a new clean up, you have to add a new CleanUp() to a particular source file. If they were contributed as extensions, then it might be possible to add more dynamically after the release of a standard Eclipse build.
Comment 1 Benno Baumgartner CLA 2007-01-05 03:51:10 EST
Marking as dependent of Bug 153755 . First we would have to make it API, then we can think of moving it somewhere else (ltk). ICleanUp has grown and is by now pretty ugly. It would cost some considerable effort to make it API (i.e. split it into two interfaces/abstract classes: ICU clean up and AST clean up). 

Clean up is very Java specific, we would have to generalize it, I'm sure if it makes much sense to move it to ltk.
Comment 2 Martin Aeschlimann CLA 2007-01-09 06:49:21 EST
Clean Up API is not on the plan for 3.3. If we're lucky and find some time in M6 we can have a look at it. If it becomes API it would go to jdt.core.manipulation.
For the least we will make the global action handler API, so other language plugins can also use the clean up keyboard shortcut. The refactoring UI framework is already available in LTK. I'm not sure if there is much more to share: I believe the clean up framework is quite Java specific: Evaluate which compilation units to run on, sharing ASTs, preference page with Java preview. Benno correct me if I missed something.
Projects with mixed content might be something, but would complicate things a lot.
Comment 3 Martin Aeschlimann CLA 2007-01-09 09:25:17 EST
setting as dup of 153755. When we add API/extension points for clean up, this will be in jdt.core.manipulation.
Until then it doesn't matter if the code is in the UI plugin or not.

*** This bug has been marked as a duplicate of bug 153755 ***