我正在尝试使用Visual Studio Code
运行点代码。我开始使用 IDEsbt launchIDE
根据指示这一页,我还安装了Dotty Language Server
and Code Runner
扩展。 Dotty 安装使用brew
我可以从 CMD 编译并执行 dotty 代码。
问题是我无法运行这段代码Visual Studio Code
因为Code Runner
正在尝试使用 scala 而不是 dotty 来执行它。
找不到任何有用的配置来调整此插件以使用 dotty。
有什么方法可以让它在 Visual Studio Code UI 中工作吗?
克隆存储库https://github.com/lampepfl/dotty-example-project(页面上提到了https://dotty.epfl.ch/docs/usage/getting-started.html)并运行
sbt launchIDE
(这是在https://dotty.epfl.ch/docs/usage/ide-support.html).
代码应该是run与 scala (运行时是相同的)。如果代码是compiled使用 scalac 而不是 dotty 这可能意味着 scalaVersion 是错误的build.sbt
或 dotty sbt 插件未打开plugins.sbt
.
![enter image description here](https://i.stack.imgur.com/PgD4l.png)
构建.sbt
lazy val root = project
.in(file("."))
.settings(
name := "dottydemo",
version := "0.1",
scalaVersion := "0.13.0-RC1"
)
插件.sbt
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.3.0")
您也可以尝试IntelliJ IDEA(尽管它没有得到官方支持)使用 Intellij IDE 运行 Scala Dotty 项目
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)