IntelliJ IDE无法正确检测Scala模板 [英] IntelliJ IDE does not detect Scala templates properly
问题描述
我试图让play框架在IntelliJ中正常工作,但似乎我的Scala模板没有被正确检测到。这些是我已经完成的步骤:
I am trying to get play framework to work properly in IntelliJ but it seems like my Scala templates aren´t detected properly. These are the steps I have done:
设置:
- Brew安装游戏
- Brew install sbt
- 下载并安装IntelliJ的play Framework插件
- 下载并安装Scala插件IntelliJ
- 下载并安装IntelliJ的SBT插件
- Brew install play
- Brew install sbt
- Download and install play Framework plugin for IntelliJ
- Download and install Scala plugin for IntelliJ
- Download and install SBT plugin for IntelliJ
从终端我运行(在以下订单):
From Terminal i run this (in the following order):
- 玩新的doTest
- 玩清洁编译
- 玩意儿
- sbt
- gen-idea
- play new doTest
- play clean compile
- play idea
- sbt
- gen-idea
在IntelliJ中我打开项目并检查文件$ b $ b target / scala-2.10 / src_managed / main / controllers / routes ,它看起来像这样:
< img src =https://i.stack.imgur.com/cLiQ9.pngalt =http://i.imgur.com/EN4iqux.png>
In IntelliJ I open the project and check the file target/scala-2.10/src_managed/main/controllers/routes and it looks like this:
我也尝试按照这些说明逐步设置全新安装:
I have also tried following these instructions step by step to set up a completely fresh installation:
完成所有步骤后,IntelliJ仍然无法解析Scala模板。这是一个完全新鲜的游戏应用程序:
And after completing all steps, IntelliJ is still unable to resolve the Scala templates. This is from a completely fresh play application:
我可以编译,从IDE运行测试并观察我在浏览器中所做的更改。唯一不起作用的是IntelliJ中的代码辅助。我不知道如何继续这一点,非常感谢任何帮助!
I can compile, run tests from the IDE and watch changes I have made in the browser. The only thing that isn´t working is the code assistance within IntelliJ. I have no idea how to proceed at this point, any help is greatly appreciated!
推荐答案
所以我终于弄明白了。似乎IntelliJ选择了编译的Scala模板。右键单击目标文件夹,然后选择将目录标记为 - >排除为我解决了问题。
So I finally managed to figure it out. It seems like IntelliJ picks up on the compiled Scala templates. Right-clicking on the target folder, and select "Mark Directory As" --> "Excluded" fixed the problem for me.
这篇关于IntelliJ IDE无法正确检测Scala模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!