organize-imports dosn't respect `groups` settings
See original GitHub issueActual behavior
With configuration
OrganizeImports {
# IntelliJ IDEA's order so that they don't fight each other
groups = [
"java."
"*"
"scala."
]
}
organize-imports
of version 0.3.0
turns
...
import scala.io.AnsiColor
import scala.language.postfixOps
import scala.sys.process._
into this
...
import scala.io.AnsiColor
import scala.sys.process._
import scala.language.postfixOps
almost as if the config were
groups = [
"java."
"*"
"scala."
"scala.language"
]
But that’s not the case.
Expected behavior
given the config above, organize-imports
should preserve this ordering
...
import scala.io.AnsiColor
import scala.language.postfixOps
import scala.sys.process._
Note
This is a problem which prevents us from adopting organize-imports
, because this fights with IntelliJ’s Optimize imports.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Organize Imports Doesn't Respect "Groups" (#78553) - GitHub
0. Description: When using "Organize Imports", import "groups" are ignored. Instead, each group should be treated individually, retaining import ...
Read more >Visual Studio code Organize imports feature - Stack Overflow
On my project I have a max-line lenght configuration, but the import plugin doesn't seem to respect this. Shouldn't it? I'm asking this ......
Read more >Optimize Imports doesn't respect import groups : WEB-43661
The Optimize Imports action should respect the import groups, as delineated by blank lines. Merging/sorting should only occur within a group.
Read more >scalacenter/scalafix - Gitter
I found that this approach doesn't respect the suppression warning in the following case: ... rules = OrganizeImports OrganizeImports.groups = ["scala.
Read more >194358 – [import rewrite] Organize Imports produces wrong ...
Set The issue is that import organizing doesn't use packages and types, but instead groups and packages in org.eclipse.jdt.internal.core.dom.rewrite.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sideeffffect, PR #42 should be able to solve your issue.
You may use the
0.3.0+1-5c3e2618-SNAPSHOT
snapshot release to try it out.@sideeffffect, 0.3.1-RC1 has been cut. A few issues were found. Sorry for the delayed release!