We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
IntelliJ 可以自动清理导入,而不仅仅是突出显示它们,而且可以清理整个目录。快捷键是
Ctrl + Alt + O
。IntelliJ can automatically clean up imports, not just highlight them, and for the whole directory. The shortcut is
Ctrl + Alt + O
.我认为 Intellij 将未使用的导入标记为灰色。我认为还没有一个自动工具。 Eclipse 和 ensime 的“组织导入”重构不会删除导入。当然,您始终可以注释掉各个导入并重新编译。
I think Intellij marks unused imports gray. I don't think there is an automatic tool yet. Eclipse's and ensime's "organize imports" refactoring doesn't remove imports. You could of course always comment out individual imports and recompile.
Scalafix 进行了重写,以删除未使用的导入: https://scalacenter.github.io/scalafix/#RemoveUnusedImports
添加
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.0-M1")
到您的project/plugins.sbt,然后运行
sbt "scalafix RemoveUnusedImports"
Scalafix has a rewrite to remove unused imports: https://scalacenter.github.io/scalafix/#RemoveUnusedImports
add
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.0-M1")
to your project/plugins.sbtthen run
sbt "scalafix RemoveUnusedImports"