Help sorting imports

I am part of a project where the import sorting rules are alphabetical, but a new line in between each letter group. I know that "Import all other imports" will sort alphabetically, but is there a way to have it add new lines in between each letter? I've already tried adding each letter and a blank line in the rules manually, but that didn't work as it wouldn't match "foo.*" to "f.*". I then tried "f*.*", but that still didn't work. Any other ideas?

2 comments
Comment actions Permalink

You could write a plugin for that.

0
Comment actions Permalink

How many different top level names are in your project? Shy of writing your own plug-in as Vojtěch suggests, I think the only thing you could do would be to add each known top level package name to the list. If a new one is added via a new dependency, you just need to add it:

import info.*
<blank line>
import net.*
<blank line>
import org.*

<blank line>

import sourceforge.*

0

Please sign in to leave a comment.