简体   繁体   English

IntelliJ无法识别Scala导入

[英]IntelliJ not recognize scala imports

Everyday when i turn on my laptop i need to organize the imports of my project, i mean, IntelliJ not recognize some imports of scala's playframework and i need to do all the time the next steps 每天,当我打开笔记本电脑时,我都需要整理项目的导入,我的意思是,IntelliJ无法识别一些scala播放框架的导入,我需要一直做下一步

  1. sbt clean sbt干净
  2. close IDE 关闭IDE
  3. delete .idea folder 删除.idea文件夹
  4. import scala SDK Module 导入scala SDK模块
  5. file/ invalidate cache and Restart finally 3 o more times cleaning the project this works ok until i turn off my laptop and start again the next day 文件/使高速缓存无效,最后重新启动3次以上,清理项目,直到我关闭笔记本电脑并在第二天再次开始时,此方法正常

this is my screen and this is my Build.sbt and this is the error , i actually works with IntelliJ 2018.3.2 sbt 1.2.7 scala 2.12.8 这是我的屏幕 ,这是我的Build.sbt ,这是错误 ,我实际上使用IntelliJ 2018.3.2 sbt 1.2.7 scala 2.12.8

IMPORTANT: my app was working ok without all the imports they aren't necessary only that you can see in the picture 重要提示:我的应用程序在没有所有导入的情况下都可以正常运行,仅在图片中您就可以看到它们了

Have you tried to prefix _root_ to all the Scala core packages? 您是否已尝试在所有Scala核心软件包的前缀_root_ Like for example... 例如...

import _root_.scala.collection.JavaConverters._
import _root_.scala.concurrent.Future

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM