Bug 178429 - [save actions] Save action should execute a clean up wizard based on a existing profile
Summary: [save actions] Save action should execute a clean up wizard based on a existi...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement with 19 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 250911 254965 257180 342800 346508 439139 439837 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-20 17:09 EDT by Willian Mitsuda CLA
Modified: 2022-02-08 09:47 EST (History)
22 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Willian Mitsuda CLA 2007-03-20 17:09:20 EDT
On Eclipse 3.3 M5 you can specify actions to be run on save, like organize imports, format code, and specify cleanup actions.

I'd like to suggest a better organization of this page based on the following points:

- Organize imports/format code actually are options on cleanup wizard, so I think it is redundant to have them there. Instead, what about just turn this configuration into a "Run cleanup wizard on save?" for now?
- About the cleanup actions: you can only define a new cleanup profile from scratch on this page, but I have a team shared cleanup profile and I'd like to just point it on this page. So, instead of having just a "Configure..." button, what about a combobox with the defined profiles, and a "Configure..." button to edit the selected profile?

I started to use the cleanup some time ago, and having this "save action" stuff on 3.3 M5 made me think about enforcing a cleanup policy on my projects, but the way the UI is actually designed makes it hard to maintain a shared policy.
Comment 1 Dani Megert CLA 2007-03-21 05:00:13 EDT
>what about just turn this
>configuration into a "Run cleanup wizard on save?" for now?
Save must never show a dialog (unless of course it fails for some reason).

> but the way the UI is actually designed makes it hard to maintain a shared 
>policy.
Simply configure it per project and share it with the repository.
Comment 2 Willian Mitsuda CLA 2007-03-21 13:26:34 EDT
(In reply to comment #1)
> >what about just turn this
> >configuration into a "Run cleanup wizard on save?" for now?
> Save must never show a dialog (unless of course it fails for some reason).
> 

Oh yes, I meant just run the configured cleanup profile without a dialog.

> > but the way the UI is actually designed makes it hard to maintain a shared 
> >policy.
> Simply configure it per project and share it with the repository.
> 

Yes, but the problem is (I'm using 3.3 M5eh): the "Configure" dialog on "Java Editor/Save Actions" preference does not let me just select my pre-configured profile. Why not just make it use the cleanup profile set on "Java Code Style/Clean Up" preference page?
Comment 3 Martin Aeschlimann CLA 2007-03-22 11:58:01 EDT
We has several iterations with the UI, starting first with the suggestion you suggested, simply specifying a user profile.
But we didn't like this solution for the following reasons:

- The most value of the 'On save actions' is 'Organize Import' and 'Format' on save. We want to encourage users to try these. The UI therefor is making these two options the most prominent. In the clean up dialog they are too hidden.

- There are clean ups that we can not perform on save, in particular the 'add missing serial id' fix.

- In the future we will provide more actions on save that won't be in clean up, and more clean up that aren't suited for on save.

At the moment we are happy with the chosen solution. No action planed.


Comment 4 Willian Mitsuda CLA 2007-03-22 12:33:00 EDT
Hum... Are you ok with reopening this once 3.4 is finished? I'm just afraid of having this marked as RESOLVED NEVER ;)
Comment 5 Dani Megert CLA 2008-10-15 10:55:43 EDT
*** Bug 250911 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2008-11-13 03:14:33 EST
*** Bug 254965 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2008-12-02 07:06:20 EST
*** Bug 250911 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2008-12-02 07:06:29 EST
*** Bug 257180 has been marked as a duplicate of this bug. ***
Comment 9 Eclipse Webmaster CLA 2009-08-30 02:35:45 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.
Comment 10 David Stenglein CLA 2009-11-06 14:45:22 EST
I don't see any answer to comment#4. There are 4 duplicate bugs since then
and I came close to entering a new one until I did enough searching to find
this.

This seems to be an illogical duplication of the superset of cleanup actions
that are shared between save actions and cleanup actions.

Having these are separate configurations makes it difficult to easily distribute
configurations that enforce organizational coding standards, since you can
easily import clean up profiles but not save actions.

Are there many more cases of save actions that cannot be done during cleanup
and vice versa?
Comment 11 Dani Megert CLA 2009-11-09 08:18:28 EST
>Are there many more cases of save actions that cannot be done during cleanup
>and vice versa?
It's the other way around i.e. some clean ups are not available on save.

As already mentioned by Martin, we don't plan to work on this.
Comment 12 Dani Megert CLA 2011-04-14 05:23:13 EDT
*** Bug 342800 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2011-05-20 01:28:18 EDT
*** Bug 346508 has been marked as a duplicate of this bug. ***
Comment 14 Dani Megert CLA 2011-05-20 01:30:30 EDT
I'm reopening this since there's quite some interest in this.
Comment 15 Juris Sudmalis CLA 2011-12-29 14:06:09 EST
Why wouldn't you add this feature for this long? The ONLY differences between Clean Up and Save Actions are that Save Actions does not add a serial version ID (I cannot imagine how is adding this a problem?) and doesn't add unimplemented methods (which, again, shouldn't be as hard as you tell it is to implement).

What are the actual reasons for declining this feature? It only makes stuff confusing and does not help at all having it the way it is right now.
Comment 16 Dani Megert CLA 2012-01-03 04:11:16 EST
> What are the actual reasons for declining this feature? 
We're not declining it - other things are just more important to us. We'd happily accept a high quality patch from people who eagerly want this.
Comment 17 Juris Sudmalis CLA 2012-01-03 05:03:36 EST
Right...
What branches do you accept the patch for? Not saying I'll be doing this (time is limited and motivation is below zero), but for other people this could be a pointer.
Also, if you're a programmer, maybe you could write the names/packages of the classes responsible for the Save Actions stuff? So it wouldn't take long to find them.
Comment 18 Dani Megert CLA 2012-01-04 09:48:54 EST
(In reply to comment #17)
> Right...
> What branches do you accept the patch for?
'master'

> Also, if you're a programmer, maybe you could write the names/packages of the
> classes responsible for the Save Actions stuff? So it wouldn't take long to
> find them.

Start too look in the 'org.eclipse.jdt.internal.corext.fix' package
Comment 19 Jeff Care CLA 2012-06-26 14:13:43 EDT
I'll add another voice asking for this. Setting up new workspaces is already frustrating enough with the myriad settings...at least in some cases we can export/import (formatter, clean-up, etc.)

I understand the reasons given why save actions aren't tied directly to cleanup, but I think there are other ways this could be handled: users could be informed that certain cleanup actions will be disabled when executed by a save for example.

I'll also say that project-specific settings are both a blessing and a curse. I recently left a project that had over a thousand projects: propagating changes in that environment was understandably a nightmare.
Comment 20 Mass Dosage CLA 2013-05-29 11:25:09 EDT
+1 asking for this. The duplication across these two areas violates DRY (which applies to User Interfaces as much as to code). There would need to be some way to clearly explain that certain clean up actions can't happen on save but other than that it would be really nice to unify all this.
Comment 21 Nathan Niesen CLA 2013-08-29 10:29:31 EDT
Please make the Save Actions use the Clean Up profile just like it does for the Formatter and Organize imports. If you think you really need Additional actions, then leave that there too.

Example:
_ Perform the selected actions on save
  _ Format the source code
    [... no changes]
  _ Organize imports
    [... no changes]
  _ Clean up source code
    Configure the clean up settings on the Clean Up page.
  _ Additional actions
    [... anything that doesn't fit above]
Comment 22 Martin Mathew CLA 2014-07-08 22:22:33 EDT
*** Bug 439139 has been marked as a duplicate of this bug. ***
Comment 23 Martin Mathew CLA 2014-07-20 21:12:39 EDT
*** Bug 439837 has been marked as a duplicate of this bug. ***
Comment 24 Milandeep Singh Shergill CLA 2020-07-16 00:27:02 EDT
Any updates on this? I am using Eclipse 2020-03 version and I still see that clean up profile and save actions configuration are managed separately and there is not way to link the Save Actions to existing clean up profiles.
Comment 25 Giacomo Baso CLA 2021-04-19 08:45:59 EDT
In Eclipse 2021-03 several save actions were moved to the "Java Feature" cleanup menu and are no longer available.

Please either allow to run the preconfigured clean up as a save action or re-enable the removed save actions.
Comment 26 Jack McKalling CLA 2022-02-08 09:47:59 EST
Although the summary suggests to use a cleanup *wizard*, I don't think this report is about suggesting to open dialogs upon save, but merely to use the cleanup profiles for save actions.

Based on that assumption, I have the following suggestion how I'd like to see it work:

- Move all cleanup profiles and cleanup operations into the save actions, except for the operations that cannot be performed on save
- Keep the operations that cannot be performed on save as separate cleanup actions in their current place, but rename said function as "Special Cleanup"
- Now if you want to do any cleanup it can be specified on save by a profile, and any special operations that don't fit there are available in the manual context menu trigger so they can still be applied.
- Because the amount of operations that cannot be done on save are far less in amount than what can be, dedicating a separate special cleanup task for these wouldn't need a profile anyway.