IntelliJ IDE无法正确检测Scala模板 [英] IntelliJ IDE does not detect Scala templates properly

查看:140
本文介绍了IntelliJ IDE无法正确检测Scala模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让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:

设置:


  1. Brew安装游戏

  2. Brew install sbt

  3. 下载并安装IntelliJ的play Framework插件

  4. 下载并安装Scala插件IntelliJ

  5. 下载并安装IntelliJ的SBT插件

  1. Brew install play
  2. Brew install sbt
  3. Download and install play Framework plugin for IntelliJ
  4. Download and install Scala plugin for IntelliJ
  5. Download and install SBT plugin for IntelliJ

从终端我运行(在以下订单):

From Terminal i run this (in the following order):


  1. 玩新的doTest

  2. 玩清洁编译

  3. 玩意儿

  4. sbt

  5. gen-idea

  1. play new doTest
  2. play clean compile
  3. play idea
  4. sbt
  5. 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与play框架结合使用

完成所有步骤后,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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆