Community
Participate
Working Groups
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.
>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.
(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?
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.
Hum... Are you ok with reopening this once 3.4 is finished? I'm just afraid of having this marked as RESOLVED NEVER ;)
*** Bug 250911 has been marked as a duplicate of this bug. ***
*** Bug 254965 has been marked as a duplicate of this bug. ***
*** Bug 257180 has been marked as a duplicate of this bug. ***
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.
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?
>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.
*** Bug 342800 has been marked as a duplicate of this bug. ***
*** Bug 346508 has been marked as a duplicate of this bug. ***
I'm reopening this since there's quite some interest in this.
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.
> 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.
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.
(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
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.
+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.
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]
*** Bug 439139 has been marked as a duplicate of this bug. ***
*** Bug 439837 has been marked as a duplicate of this bug. ***
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.
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.
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.