This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve the original source-level formatting when possible after exp…
…loding imports (#280)
- Loading branch information
Showing
4 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
input/src/main/scala/fix/ExplodeImportsFormatPreserving.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,12 @@ | ||
/* | ||
rules = [OrganizeImports] | ||
OrganizeImports.removeUnused = false | ||
OrganizeImports.groupedImports = Explode | ||
*/ | ||
|
||
package fix | ||
|
||
import fix.ExplodeImports.FormatPreserving.g1.{ a, b } | ||
import fix.ExplodeImports.FormatPreserving.g2.{ c => C, _ } | ||
|
||
object ExplodeImportsFormatPreserving |
7 changes: 7 additions & 0 deletions
7
output/src/main/scala/fix/ExplodeImportsFormatPreserving.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,7 @@ | ||
package fix | ||
|
||
import fix.ExplodeImports.FormatPreserving.g1.a | ||
import fix.ExplodeImports.FormatPreserving.g1.b | ||
import fix.ExplodeImports.FormatPreserving.g2.{ c => C, _ } | ||
|
||
object ExplodeImportsFormatPreserving |
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,60 @@ | ||
package fix | ||
|
||
object ExplodeImports { | ||
object Wildcard1 { | ||
object a | ||
object b | ||
object c | ||
object d | ||
} | ||
|
||
object Wildcard2 { | ||
object a | ||
object b | ||
} | ||
|
||
object Unimport1 { | ||
object a | ||
object b | ||
object c | ||
object d | ||
} | ||
|
||
object Unimport2 { | ||
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 | ||
} | ||
|
||
object Dedup { | ||
object a | ||
object b | ||
object c | ||
} | ||
|
||
object FormatPreserving { | ||
object g1 { | ||
object a | ||
object b | ||
} | ||
|
||
object g2 { | ||
object c | ||
object d | ||
} | ||
} | ||
} |