wmyywm / eclipse-code-formatter-intellij-plugin

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

Eclipse Organize Imports new lines in IntelliJ #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

Was just wondering if new lines between import groups is a supported use case.

When I do Source -> Format, Source -> Organize imports in eclipse, the import 
statement groups are separated by newlines. 

In IntelliJ when I use the Eclipse Code Formatter, either with or without 
Optimize imports, the order is correct, but the new lines are not added in as 
expected.

Thanks

Original issue reported on code.google.com by Matthew....@gmail.com on 15 Apr 2013 at 5:15

GoogleCodeExporter commented 9 years ago
Yes it is supported.
Post an example.

Original comment by vojta.kr...@gmail.com on 15 Apr 2013 at 7:34

GoogleCodeExporter commented 9 years ago
Managed to correct the problem, I was using the org.eclipse.jdt.core.prefs file 
but then I decided to try:

Eclipse -> Project properties -> Java Code Style
- enable per project settings for Formatter and Organize Imports
- export Formatter to .xml
- export organize imports to .importorder

Set Eclipse Code Formatter IJ settings to the exported files rather than the 
.prefs file

Restart IJ
Reformat using CTRL+ALT+L
Don't optimize imports,

everything worked as advertised; not sure why I was having trouble with the 
.prefs file but it's a non-issue. Thanks for the plugin and rapid response. 

Original comment by Matthew....@gmail.com on 15 Apr 2013 at 9:03

GoogleCodeExporter commented 9 years ago
if you use org.eclipse.jdt.core.prefs for import order, then it won't work, you 
would need a different prof file... Also restart should not be needed :-)

Original comment by vojta.kr...@gmail.com on 15 Apr 2013 at 9:11