EclipseCodeFormatter icon indicating copy to clipboard operation
EclipseCodeFormatter copied to clipboard

Create cleanups like "Use blocks in if/while/for/do statements"

Open krasa opened this issue 11 years ago • 15 comments
trafficstars

intellij already does some thing, we need to just hook them somehow.

krasa avatar Jan 25 '14 13:01 krasa

+1. Yes, please Implement Clean Up Settings from Eclipse

mstachniuk avatar Apr 14 '14 13:04 mstachniuk

Yes, someone pls implement it :-)

krasa avatar Apr 14 '14 22:04 krasa

:+1:

Potherca avatar Mar 27 '15 11:03 Potherca

+1

mbykovskyy avatar Jul 08 '15 18:07 mbykovskyy

+1

igyorgyi avatar Jan 10 '17 13:01 igyorgyi

It would be nice to use the clean up xml file also. We need exactly this setting: setting id="cleanup.use_blocks" value="true"

igyorgyi avatar Jan 10 '17 13:01 igyorgyi

Pull request welcomed, something like that is implemented in https://plugins.jetbrains.com/idea/plugin/7642-save-actions

krasa avatar Jan 10 '17 14:01 krasa

I miss only adding {} to the blocks. Because this is set in Eclipse in the Clean Up settings. "Yes, please Implement Clean Up Settings from Eclipse" As without code cleanup Eclipse formatting cannot be applied to IDEA as it is. Any plans on this? Maybe only this setting from the cleanup?

For example, without this you will receive formatting like this: if (true) return; else return;

instead of:

if (true) { return; } else { return; }

We are using Member Accesses and Missing Code tab also from the clean up. It's a pretty cool stuff in Eclipse.

igyorgyi avatar Jan 10 '17 15:01 igyorgyi

You've got such differences: image

igyorgyi avatar Jan 10 '17 16:01 igyorgyi

I have no use for this or plans to implement it. But I am willing to click on Merge pull request button...

krasa avatar Jan 10 '17 17:01 krasa

not sounds good

igyorgyi avatar Jan 10 '17 17:01 igyorgyi

FYI This plugin only provides formatting features. Cleanups in Eclipse are refactoring actions, not formatting actions. Different API, different engine.

So file feature requests at https://github.com/dubreuia/intellij-plugin-save-actions like @krasa said.

markiewb avatar Apr 10 '17 07:04 markiewb

It probably wouldn't be a problem to add such features here, you could just copypaste it from the Save Actions plugin.

krasa avatar Apr 10 '17 10:04 krasa

This works great with the save-actions plugins, IMO we could close this issue.

jebeaudet avatar Mar 16 '22 21:03 jebeaudet

https://github.com/dubreuia/intellij-plugin-save-actions is archived, forked here https://github.com/MarvelousAnything/intellij-plugin-save-actions Another fork seems to have been added to Intellij plugin marketplace.

Wouldn't it make sense to add it as another goal to this plugin?

delanym avatar Apr 20 '23 14:04 delanym