forked from scalacenter/scalafix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various corner cases while merging imports with the same prefix (s…
- Loading branch information
Showing
12 changed files
with
220 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
rules = OrganizeImports | ||
OrganizeImports.groupedImports = Merge | ||
OrganizeImports.importSelectorsOrder = Ascii | ||
*/ | ||
package fix | ||
|
||
import fix.MergeImports.Rename1.{a => A} | ||
import fix.MergeImports.Rename1.{b => B} | ||
import fix.MergeImports.Rename1.c | ||
import fix.MergeImports.Rename1.d | ||
|
||
import fix.MergeImports.Rename2.a | ||
import fix.MergeImports.Rename2.{a => A} | ||
import fix.MergeImports.Rename2.b | ||
import fix.MergeImports.Rename2.{b => B} | ||
import fix.MergeImports.Rename2.c | ||
|
||
object GroupedImportsMergeRenames |
13 changes: 13 additions & 0 deletions
13
input/src/main/scala/fix/GroupedImportsMergeUnimports.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
rules = OrganizeImports | ||
OrganizeImports.groupedImports = Merge | ||
OrganizeImports.importSelectorsOrder = Ascii | ||
*/ | ||
package fix | ||
|
||
import fix.MergeImports.Unimport.{a => _, _} | ||
import fix.MergeImports.Unimport.{b => B} | ||
import fix.MergeImports.Unimport.{c => _, _} | ||
import fix.MergeImports.Unimport.d | ||
|
||
object GroupedImportsMergeUnimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package fix | ||
|
||
import fix.ExpandRelativeQuotedIdent.`a.b` | ||
import fix.ExpandRelativeQuotedIdent.`a.b`.c | ||
import fix.QuotedIdent.`a.b` | ||
import fix.QuotedIdent.`a.b`.c | ||
|
||
object ExpandRelativeQuotedIdent { | ||
object `a.b` { | ||
object c | ||
} | ||
val refC = c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package fix | ||
|
||
import fix.MergeImports.Rename1.{a => A, b => B, c, d} | ||
import fix.MergeImports.Rename2.{a => A, b => B, c} | ||
import fix.MergeImports.Rename2.{a, b} | ||
|
||
object GroupedImportsMergeRenames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package fix | ||
|
||
import fix.MergeImports.Unimport.{b => B, c => _, _} | ||
|
||
object GroupedImportsMergeUnimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package fix | ||
|
||
import scala.collection.{mutable, _} | ||
import fix.MergeImports.Wildcard1._ | ||
import fix.MergeImports.Wildcard1.{b => B} | ||
import fix.MergeImports.Wildcard2._ | ||
|
||
object GroupedImportsMergeWildcard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package fix | ||
|
||
object MergeImports { | ||
object Wildcard1 { | ||
object a | ||
object b | ||
object c | ||
object d | ||
} | ||
|
||
object Wildcard2 { | ||
object a | ||
object b | ||
} | ||
|
||
object Unimport { | ||
object a | ||
object b | ||
object c | ||
object d | ||
} | ||
|
||
object Rename1 { | ||
object a | ||
object b | ||
object c | ||
object d | ||
} | ||
|
||
object Rename2 { | ||
object a | ||
object b | ||
object c | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package fix | ||
|
||
object QuotedIdent { | ||
object `a.b` { | ||
object c | ||
} | ||
} |