-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OrganizeImports: support Scala3 syntax
- Loading branch information
Showing
55 changed files
with
264 additions
and
27 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
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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...zeImports/CurlyBracedSingleImportee.scala → ...zeImports/CurlyBracedSingleImportee.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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package test.organizeImports | ||
|
||
import scala.collection.Map | ||
import scala.collection.{Seq => _} | ||
import scala.collection.{Set => ImmutableSet} | ||
|
||
object CurlyBracedSingleImportee |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...izeImports/ImportsOrderSymbolsFirst.scala → ...izeImports/ImportsOrderSymbolsFirst.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
scalafix-tests/output/src/main/scala-3/test/organizeImports/CoalesceImportees.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,8 @@ | ||
package test.organizeImports | ||
|
||
import scala.collection.immutable.{Map, Seq, Vector} | ||
import scala.collection.mutable.* | ||
import scala.concurrent.{Channel as Ch, *} | ||
import scala.util.{Random as _, *} | ||
|
||
object CoalesceImportees |
4 changes: 2 additions & 2 deletions
4
...-tests/output/src/main/scala-3/test/organizeImports/CoalesceImporteesGivensAndNames.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.Givens._ | ||
import test.organizeImports.Givens.{B => B1, C => _, _, given} | ||
import test.organizeImports.Givens.* | ||
import test.organizeImports.Givens.{B as B1, C as _, *, given} | ||
|
||
object CoalesceImporteesGivensAndNames |
2 changes: 1 addition & 1 deletion
2
scalafix-tests/output/src/main/scala-3/test/organizeImports/CoalesceImporteesNoGivens.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.Givens.{C => C1, _} | ||
import test.organizeImports.Givens.{C as C1, *} | ||
|
||
object CoalesceImporteesNoGivens |
2 changes: 1 addition & 1 deletion
2
...tests/output/src/main/scala-3/test/organizeImports/CoalesceImporteesNoGivensNoNames.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.Givens.{A => A1, B => _, _} | ||
import test.organizeImports.Givens.{A as A1, B as _, *} | ||
|
||
object CoalesceImporteesNoGivensNoNames |
4 changes: 2 additions & 2 deletions
4
scalafix-tests/output/src/main/scala-3/test/organizeImports/CoalesceImporteesNoNames.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.Givens._ | ||
import test.organizeImports.Givens.{A => A1, given} | ||
import test.organizeImports.Givens.* | ||
import test.organizeImports.Givens.{A as A1, given} | ||
|
||
object CoalesceImporteesNoNames |
7 changes: 7 additions & 0 deletions
7
scalafix-tests/output/src/main/scala-3/test/organizeImports/CurlyBracedSingleImportee.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 test.organizeImports | ||
|
||
import scala.collection.Map | ||
import scala.collection.Seq as _ | ||
import scala.collection.Set as ImmutableSet | ||
|
||
object CurlyBracedSingleImportee |
2 changes: 1 addition & 1 deletion
2
scalafix-tests/output/src/main/scala-3/test/organizeImports/DeduplicateGivenImportees.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
7 changes: 7 additions & 0 deletions
7
scalafix-tests/output/src/main/scala-3/test/organizeImports/DeduplicateImportees.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 test.organizeImports | ||
|
||
import scala.collection.immutable.Map as Dict | ||
import scala.collection.immutable.Vector | ||
import scala.collection.immutable.{Set as _, *} | ||
|
||
object DeduplicateImportees |
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
14 changes: 14 additions & 0 deletions
14
scalafix-tests/output/src/main/scala-3/test/organizeImports/ExpandRelativeEmptyPackage.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,14 @@ | ||
import P.* | ||
import Q.* | ||
import Q.x | ||
|
||
object P { | ||
object x | ||
} | ||
|
||
object Q { | ||
object x | ||
object y | ||
} | ||
|
||
object ExpandRelativeEmptyPackage |
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
7 changes: 7 additions & 0 deletions
7
...x-tests/output/src/main/scala-3/test/organizeImports/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 test.organizeImports | ||
|
||
import test.organizeImports.ExplodeImports.FormatPreserving.g1.a | ||
import test.organizeImports.ExplodeImports.FormatPreserving.g1.b | ||
import test.organizeImports.ExplodeImports.FormatPreserving.g2.{ c as C, * } | ||
|
||
object ExplodeImportsFormatPreserving |
6 changes: 3 additions & 3 deletions
6
...ests/output/src/main/scala-3/test/organizeImports/GroupedGivenImportsMergeUnimports.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.GivenImports._ | ||
import test.organizeImports.GivenImports.{gamma => _, given Beta, given Zeta, given} | ||
import test.organizeImports.GivenImports2.{alpha => _, beta => _} | ||
import test.organizeImports.GivenImports.* | ||
import test.organizeImports.GivenImports.{gamma as _, given Beta, given Zeta, given} | ||
import test.organizeImports.GivenImports2.{alpha as _, beta as _} | ||
import test.organizeImports.GivenImports2.{given Gamma, given Zeta} | ||
|
||
object GroupedGivenImportsMergeUnimports |
8 changes: 4 additions & 4 deletions
8
.../output/src/main/scala-3/test/organizeImports/GroupedImportsAggressiveMergeGivenAll.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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.GivenImports._ | ||
import test.organizeImports.GivenImports.* | ||
import test.organizeImports.GivenImports.given | ||
import test.organizeImports.MergeImports.Wildcard1._ | ||
import test.organizeImports.MergeImports.Wildcard1.{b => B} | ||
import test.organizeImports.MergeImports.Wildcard2._ | ||
import test.organizeImports.MergeImports.Wildcard1.* | ||
import test.organizeImports.MergeImports.Wildcard1.b as B | ||
import test.organizeImports.MergeImports.Wildcard2.* | ||
|
||
|
||
object GroupedImportsAggressiveMergeGivenAll |
7 changes: 7 additions & 0 deletions
7
.../output/src/main/scala-3/test/organizeImports/GroupedImportsAggressiveMergeWildcard.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 test.organizeImports | ||
|
||
import test.organizeImports.MergeImports.Wildcard1.* | ||
import test.organizeImports.MergeImports.Wildcard1.b as B | ||
import test.organizeImports.MergeImports.Wildcard2.* | ||
|
||
object GroupedImportsAggressiveMergeWildcard |
7 changes: 7 additions & 0 deletions
7
scalafix-tests/output/src/main/scala-3/test/organizeImports/GroupedImportsExplodeMixed.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 test.organizeImports | ||
|
||
import scala.collection.immutable.* | ||
import scala.collection.mutable.Map | ||
import scala.collection.mutable.{Buffer as _, Seq as S, *} | ||
|
||
object GroupedImportsExplodeMixed |
5 changes: 5 additions & 0 deletions
5
...ix-tests/output/src/main/scala-3/test/organizeImports/GroupedImportsExplodeUnimport.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,5 @@ | ||
package test.organizeImports | ||
|
||
import scala.collection.{Seq as _, *} | ||
|
||
object GroupedImportExplodeUnimport |
5 changes: 5 additions & 0 deletions
5
scalafix-tests/output/src/main/scala-3/test/organizeImports/GroupedImportsMergeDedup.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,5 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.MergeImports.Dedup.{a, b as b1, c as _} | ||
|
||
object GroupedImportsMergeDedup |
7 changes: 7 additions & 0 deletions
7
scalafix-tests/output/src/main/scala-3/test/organizeImports/GroupedImportsMergeRenames.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 test.organizeImports | ||
|
||
import test.organizeImports.MergeImports.Rename1.{a as A, b as B, c, d} | ||
import test.organizeImports.MergeImports.Rename2.{a as A, b as B, c} | ||
import test.organizeImports.MergeImports.Rename2.{a, b} | ||
|
||
object GroupedImportsMergeRenames |
6 changes: 6 additions & 0 deletions
6
...fix-tests/output/src/main/scala-3/test/organizeImports/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,6 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.MergeImports.Unimport1.{b as B, c as _, d, *} | ||
import test.organizeImports.MergeImports.Unimport2.{a as _, b as _, c as C, d} | ||
|
||
object GroupedImportsMergeUnimports |
7 changes: 7 additions & 0 deletions
7
...afix-tests/output/src/main/scala-3/test/organizeImports/GroupedImportsMergeWildcard.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 test.organizeImports | ||
|
||
import test.organizeImports.MergeImports.Wildcard1.b as B | ||
import test.organizeImports.MergeImports.Wildcard1.{d, *} | ||
import test.organizeImports.MergeImports.Wildcard2.{a, b, *} | ||
|
||
object GroupedImportsMergeWildcard |
11 changes: 11 additions & 0 deletions
11
scalafix-tests/output/src/main/scala-3/test/organizeImports/Groups.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,11 @@ | ||
package test.organizeImports | ||
|
||
import java.time.Clock | ||
import javax.net.ssl | ||
|
||
import sun.misc.Unsafe | ||
|
||
import scala.collection.JavaConverters.* | ||
import scala.concurrent.ExecutionContext | ||
|
||
object Groups |
14 changes: 14 additions & 0 deletions
14
scalafix-tests/output/src/main/scala-3/test/organizeImports/GroupsLongestMatch.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,14 @@ | ||
package test.organizeImports | ||
|
||
import java.time.Clock | ||
import javax.net.ssl | ||
|
||
import scala.collection.JavaConverters.* | ||
import scala.concurrent.ExecutionContext | ||
|
||
import scala.util.Random | ||
import scala.util.control.NonFatal | ||
|
||
import sun.misc.Unsafe | ||
|
||
object GroupsLongestMatch |
12 changes: 12 additions & 0 deletions
12
scalafix-tests/output/src/main/scala-3/test/organizeImports/ImportsOrderKeep.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 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.QuotedIdent.`a.b`.`{ d }`.e | ||
import test.organizeImports.QuotedIdent.* | ||
import test.organizeImports.QuotedIdent.`a.b`.{c as _, *} | ||
|
||
import scala.concurrent.ExecutionContext.Implicits.* | ||
import scala.concurrent.duration | ||
import scala.concurrent.* | ||
import scala.concurrent.{Promise, Future} | ||
|
||
object ImportsOrderKeep |
15 changes: 15 additions & 0 deletions
15
scalafix-tests/output/src/main/scala-3/test/organizeImports/ImportsOrderSymbolsFirst.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,15 @@ | ||
package test.organizeImports | ||
|
||
import test.organizeImports.QuotedIdent.* | ||
import test.organizeImports.QuotedIdent.`a.b` | ||
import test.organizeImports.QuotedIdent.`a.b` as ab | ||
import test.organizeImports.QuotedIdent.`a.b`.{c as _, *} | ||
import test.organizeImports.QuotedIdent.`a.b`.`{ d }`.e | ||
import test.organizeImports.QuotedIdent.`a.b`.`{ d }`.e as E | ||
|
||
import scala.concurrent.* | ||
import scala.concurrent.{Promise, Future} | ||
import scala.concurrent.ExecutionContext.Implicits.* | ||
import scala.concurrent.duration | ||
|
||
object ImportsOrderSymbolsFirst |
Oops, something went wrong.