Intellij falsely marked some import of Scala implicits as not being use. Is there a way to prevent it from deleting those import when optimized them explicitly for a specific import and not prevent optimized import for the entire project ?
相关问题
- Unusual use of the new keyword
- Get Runtime Type picked by implicit evidence
- What's the point of nonfinal singleton objects
- PlayFramework: how to transform each element of a
- How to reimport module with ES6 import
相关文章
- Gatling拓展插件开发,check(bodyString.saveAs("key"))怎么实现
- RDF libraries for Scala [closed]
- In IntelliJ IDEA, how can I create a key binding t
- Why is my Dispatching on Actors scaled down in Akk
- IntelliJ IDEA can't open projects or add SDK o
- How do you run cucumber with Scala 2.11 and sbt 0.
- GRPC: make high-throughput client in Java/Scala
- IntelliJ Subversion Authentication Required Dialog
I'm afraid there isn't, I had similar issues especially when using
akka
and importing the implicit execution context from anActorSystem
in some cases. I recommend defining the value instead of importing. One such example would be:I hope this helps you.
IntelliJ's Scala plugin now allows you to suppress this false warning on a project-wide level. That may not be appropriate for all cases, but it can help. Click the lightbulb then select "Mark import as always used in this project"
Alternatively you can add this directly to your code style xml:
IntelliJ usually stores that file at
.idea/codeStyles/Project.xml
. It may be a good idea to commit this to your repository so it can be shared.Unfortunately there isn't a fix and the problem appears to originate in the compiler itself.
See https://youtrack.jetbrains.com/issue/SCL-7335 which leads to https://issues.scala-lang.org/browse/SI-8773 (reported in 2014 but no fix yet).