wmyywm / eclipse-code-formatter-intellij-plugin

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

New line created when some packages from import order are not imported #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using the latest 11 version of IntelliJ (11.1.4) with the latest eclipse 
code formatter plugin version (3.0.3)

I have a manual configuration for the import order with the following values: 
com;java;javax;org;
The native organize import is disabled when I reformat my code.

When the class does not contain any javax related class, a new line is created 
after each formart between the imports/class definition, until 4 lines is 
reached.

Example:
So on the first reformat:
package org.example;

import java.util.Calendar;

public class ImportTest {

    public static void main( String[] args ) {
        Calendar.getInstance();
    }
}

2nd format:
package org.example;

import java.util.Calendar;

public class ImportTest {

    public static void main( String[] args ) {
        Calendar.getInstance();
    }
}

3rd format:
package org.example;

import java.util.Calendar;

public class ImportTest {

    public static void main( String[] args ) {
        Calendar.getInstance();
    }
}

4th + format:
package org.example;

import java.util.Calendar;

public class ImportTest {

    public static void main( String[] args ) {
        Calendar.getInstance();
    }
}

If I have a javax import, it doesn't create a new line.
For each format:
package org.example;

import java.util.Calendar;

import javax.xml.XMLConstants;

public class ImportTest {

    public static void main( String[] args ) {
        Calendar.getInstance();
        String ns = XMLConstants.DEFAULT_NS_PREFIX;
    }
}

Original issue reported on code.google.com by rich....@gmail.com on 30 Nov 2012 at 1:58

GoogleCodeExporter commented 9 years ago
One thing to note is the eclipse formatter configuration has a maximum of 4 
lines between import/class.

Original comment by rich....@gmail.com on 30 Nov 2012 at 2:02

GoogleCodeExporter commented 9 years ago
you can try new version.

Original comment by vojta.kr...@gmail.com on 30 Nov 2012 at 2:21

GoogleCodeExporter commented 9 years ago
ehm, it need a little bit more work.

Original comment by vojta.kr...@gmail.com on 30 Nov 2012 at 2:26

GoogleCodeExporter commented 9 years ago
done in 3.1.3.1

Original comment by vojta.kr...@gmail.com on 30 Nov 2012 at 2:36

GoogleCodeExporter commented 9 years ago
It works.

Thanks for the quick response time!

Original comment by rich....@gmail.com on 30 Nov 2012 at 3:15

GoogleCodeExporter commented 9 years ago
you're welcome.

Original comment by vojta.kr...@gmail.com on 30 Nov 2012 at 10:01