wmyywm / eclipse-code-formatter-intellij-plugin

Automatically exported from code.google.com/p/eclipse-code-formatter-intellij-plugin
0 stars 0 forks source link

Formatting one file multiple times toggles blanks between import groups #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 

configured the import feature like you've described. Unfortunately I experience 
strange behavior if I format a file more than one time:
The blanks between groups of imports disappear on one format action and 
reappear on the next format command, so they toogle between blanks are present 
between groups and no blanks between groups. 

Original issue reported on code.google.com by chris.we...@gmail.com on 15 Mar 2012 at 10:47

GoogleCodeExporter commented 9 years ago
i think you have enabled import optimizing.

Original comment by vojta.kr...@gmail.com on 15 Mar 2012 at 10:49

GoogleCodeExporter commented 9 years ago
i mean intellij's import optimizing...  

Original comment by vojta.kr...@gmail.com on 15 Mar 2012 at 10:49

GoogleCodeExporter commented 9 years ago
Hmm, I'm not sure if i understood your howto correctly: "IntelliJ's Import 
Optimizing must be turned off (Settings-Editor-Show "Reformat Code" dialog...)"

I've unchecked "Show Reformat code dialog" as you suggest above, but directly 
below this option, there's an option for "Show Optimize Imports Dialog". Should 
this also be unchecked?

Original comment by chris.we...@gmail.com on 15 Mar 2012 at 11:00

GoogleCodeExporter commented 9 years ago
well, turn on showing the dialog, and when  the reformat code dialog shows up, 
uncheck the import optimization. 

Original comment by vojta.kr...@gmail.com on 15 Mar 2012 at 11:05

GoogleCodeExporter commented 9 years ago
ah ok, quite clear, sorry I'm new to Idea and obviously had not one of my 
clearest day today :-)

Original comment by chris.we...@gmail.com on 15 Mar 2012 at 11:10

GoogleCodeExporter commented 9 years ago
no problem, and if the imports will not be exactly like in eclipse, do not 
worry, i will release new version in few days.

Original comment by vojta.kr...@gmail.com on 15 Mar 2012 at 11:26

GoogleCodeExporter commented 9 years ago
Hi,

now I've turned import optimizing off in the "Reformat Code" Dialog, but the 
"toggle" behaviour for the blank lines between the groups is still there, every 
time use the reformat action. I use 11.0.2.

Regards
Chris

Original comment by chris.we...@gmail.com on 16 Mar 2012 at 7:52

GoogleCodeExporter commented 9 years ago
and OS?

Original comment by vojta.kr...@gmail.com on 16 Mar 2012 at 7:59

GoogleCodeExporter commented 9 years ago
nevermind, it is doing the same thing to me :D 

Original comment by vojta.kr...@gmail.com on 16 Mar 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Ah ok :-D, how is your workflow of letting idea organize your imports/format 
your code? Do you only let it happen in the commit dialog, and does this always 
group the imports correctly? (As an eclipese user I've made heavy use Save 
Actions, but this concept isn't present in idea cos of it's deferred saving, I 
think.)

Original comment by chris.we...@gmail.com on 16 Mar 2012 at 8:08

GoogleCodeExporter commented 9 years ago
I mostly commit different file types or some legacy which should not be 
reformatted so I do not reformat on commit, but every file alone when it is 
necessary.

you can format on save 
http://stackoverflow.com/questions/946993/intellij-reformat-on-file-save

anyway I fixed this bug, thank you.

Original comment by vojta.kr...@gmail.com on 16 Mar 2012 at 8:19