Hello Jeff,
[...]
> My feedback: I would like an option to not specify groups, and have
> it automatically insert the line break on changes in the first two
> sections of the package/domain. e.g.
>
> com.a.b
> com.a.c.d
> com.c.d
> com.x.y
> com.x.z
> java.x.y
> mno.g.h.i
>
> would break/sort as
> com.a.b
> com.a.c.d
>
> com.c.d
>
> com.x.y
> com.x.z
>
> java.x.y
>
> mno.g.h.i
[...]
Thank you for your feedback :-)
The attached jde-import-org.el is a new improved library to organize
Java import statements. It defines the command `jde-import-organize'
which breaks/sorts imports following group definitions in
`jde-import-group-rules'.
So now to automatically insert the line break on changes in the first
two sections of the package/domain you can set `jde-import-group-rules'
like the following:
'(("^javax?\\.") ("^[^.]+[.][^.]+[.]" . 0))
And imports statements will be organized in:
- a first group for standard java packages.
- a group for each package with different first two sections.
- a last group for imports not belonging to the above ones.
See the source code for more details on how to customize
`jde-import-group-rules'.
Any feedback will be welcome.
Sincerely,
David
jde-import-org.el