-
Notifications
You must be signed in to change notification settings - Fork 22
Ability to control blank lines between groups #140
Comments
@nafg, that's a nice feature request. It cannot be done today but can be added relatively easily. I'd add one configuration named When With this, your sample configuration can be translated into:
WDYT? |
Maybe use |
That sounds like a great strategy.
…On Mon, Dec 14, 2020 at 8:59 PM Cheng Lian ***@***.***> wrote:
Maybe use --- instead of - to make the blank line groups easier to locate
visually.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAYAUDUQ5GPESUKXZ4PDF3SU27IVANCNFSM4UZYH2YQ>
.
|
@nafg I had a draft implementation for this feature in PR #142. It turned out to be much hairier than I initially expected. I'll try to see whether things can be refactored and simplified. On the other hand, here's a workaround that largely satisfies your requirement. You can configure the OrganizeImports {
groups = [
"re:javax?\\."
"scala."
"re:(org\\.scalajs|play|net\\.liftweb|reactive|slick|japgolly|io\\.github\\.nafg)\\."
"*"
"chesednow"
]
} The only thing is that the 3rd group will sort all the imports in that group according to the |
My main reason is that being able to use it without making changes across
the codebase. I primarily use intellij to organize imports. If I could run
a fast command line tool across the codebase that would not rock the boat
too much it would be nice.
…On Wed, Dec 16, 2020, 2:47 PM Cheng Lian ***@***.***> wrote:
@nafg <https://github.com/nafg> I had a draft implementation for this
feature in PR #142
<#142>. It
turned out to be much hairier than I initially expected. I'll try to see
whether things can be refactored and simplified. On the other hand, here's
a workaround that largely satisfies your requirement. You can configure the
OrganizeImports as following:
OrganizeImports {
groups = [
"re:javax?\\."
"scala."
"re:(org\\.scalajs|play|net\\.liftweb|reactive|slick|japgolly|io\\.github\\.nafg)\\."
"*"
"chesednow"
]
}
The only thing is that the 3rd group will sort all the imports in that
group according to the importsOrder configuration, so it does not
strictly reflect the original order you wanted. However, I think it makes
more sense to order them alphabetically instead of using an ad-hoc order?
Are there any reasons why you prefer the specific order you listed in the
PR description?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAYAUFI3J2OOHJB3JTRMBLSVEFD5ANCNFSM4UZYH2YQ>
.
|
I would like to reproduce my intellij config as closely as possible. In .idea/codeStyles/Project.xml I have this:
So for example, imports from
japgolly
should always go before imports fromio.github.nafg
, however I don't want a blank line between them.Is there any way to achieve this, or could there be?
The text was updated successfully, but these errors were encountered: