使用scala插件在IntelliJ Ultimate 13.1.1中创建SBT项目不会产生New>用于src/main/scala的Scala对象? [英] Creating SBT Project in IntelliJ Ultimate 13.1.1 with Scala plugin gives no New > Scala object for src/main/scala?

查看:219
本文介绍了使用scala插件在IntelliJ Ultimate 13.1.1中创建SBT项目不会产生New>用于src/main/scala的Scala对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Scala中的快速Hello World应用程序开始.

I'm trying to get started with a quick Hello World application in Scala.

我正在使用IntelliJ Ultimate 13.1.1.我已经下载了Scala插件.我还下载了SBT插件.项目SDK是Java 1.6.

I'm using IntelliJ Ultimate 13.1.1. I've downloaded the Scala plugin. I've also downloaded the SBT plugin. The project SDK is Java 1.6.

我继续创建了一个新项目.我选择了SBT Project.项目创建良好.我注意到src/main/*src/test/*文件夹创建的很好.

I went ahead and created a new project. I selected SBT Project. The project is created fine. I notice that the src/main/* and src/test/* folders are created nicely.

当我右键单击src/main/scala文件夹并尝试创建一个新的Scala对象时,没有选择这样做吗?我试图将目录标记为源根.但是,问题仍然存在.我可以选择创建Java文件,但不能创建Scala文件.

When I right-click on the src/main/scala folder and try to create a new Scala object, there's no option to do so?! I tried to mark the directory as a sources root. Still, the issue persists. I'm given the option to create a Java file but not a Scala file.

这是怎么回事?!在过去的两个小时里,我一直在努力.

What's going on?! I've been pulling my hair on this for the past two hours.

推荐答案

这是IntelliJ中的错误.这是我提交的错误报告(#25058 )的答案:

This is a bug in IntelliJ. Here is the answer to a bug report (#25058) I submitted:

Andrey Dernov(JetBrains支持) 3月26日19:43

Andrey Dernov (JetBrains Support) Mar 26 19:43

请查看开发者的回复:

戴夫,问题出在(主要是)因为大写字母 ( http://youtrack.jetbrains.com/issue/SCL-6853 ).您可以使用 小写的项目名称,或等待新的插件版本修复 问题.谢谢您的错误报告!

Hi Dave, the problem was (mostly) because of the uppercase letter (http://youtrack.jetbrains.com/issue/SCL-6853). You can either use lowercase project name, or wait for a new plugin build that fixes the issue. Thank you for the bug report!

您可以通过显式编辑Run-> Edit Configurations并添加要运行的类来解决它.设置主类并删除$(对于对象).

You can get around it by explicitly editing the Run -> Edit Configurations and adding the class that you want to run. Set the main class and delete the $ (for the object).

这篇关于使用scala插件在IntelliJ Ultimate 13.1.1中创建SBT项目不会产生New>用于src/main/scala的Scala对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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