Skip to content

Commit

Permalink
docs: OrganizeImports.removeUnused is now supported with 3.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
bjaglin committed Feb 3, 2024
1 parent e670b16 commit 43aee81
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions docs/rules/OrganizeImports.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,11 @@ do not rewrite import statements in ways that conflict with

Known limitations:

1. The [`removeUnused`](OrganizeImports.md#removeunused) option must be
explicitly set to `false` - the rule currently doesn’t remove unused
imports as it is currently not supported by the compiler.

2. Usage of [deprecated package
1. Usage of [deprecated package
objects](http://dotty.epfl.ch/docs/reference/dropped-features/package-objects.html)
may result in incorrect imports.

3. The
2. The
[`groupExplicitlyImportedImplicitsSeparately`](OrganizeImports.md#groupexplicitlyimportedimplicitsseparately)
option has no effect.

Expand Down Expand Up @@ -1279,12 +1275,9 @@ Remove unused imports.
> using Scala compilation diagnostics information, and the compilation phase
> happens before Scalafix rules get applied.
> The `removeUnused` option is currently not supported for source files
> compiled with Scala 3, as the [compiler cannot issue warnings for unused
> imports
> yet](https://docs.scala-lang.org/scala3/guides/migration/options-lookup.html#warning-settings).
> As a result, you must set `removeUnused` to `false` when running the
> rule on source files compiled with Scala 3.
> The `removeUnused` option is not supported for source files compiled with
> early versions of Scala 3 as these do not export SemanticDB diagnostics for
> unused imports. You must use Scala 3.4.0 or later to use it.
### Value type

Expand All @@ -1299,7 +1292,7 @@ Boolean
```conf
OrganizeImports {
groups = ["javax?\\.", "scala.", "*"]
removeUnused = true // not supported in Scala 3
removeUnused = true
}
```

Expand Down

0 comments on commit 43aee81

Please sign in to comment.