我正在尝试使用Visual Studio Code来运行dotty代码。我根据sbt launchIDE的指示使用此页启动了IDE,我还安装了Dotty Language Server和Code Runner扩展。Dotty是使用brew安装的,我可以从CMD编译和执行dotty代码。
问题是我不能从Visual Studio Code运行这段代码,因为Code Runner试图使用scala而不是dotty来执行它。
找不到任何有用的配置来调整这个插件来使用dotty。
是否有任何方法使其从中工作?
发布于 2019-03-09 16:10:04
克隆存储库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进行的)。
代码应该是运行和scala (运行时相同)。如果代码是用scalac而不是dotty编译的,这可能意味着scalaVersion在build.sbt中错了,或者在plugins.sbt中没有打开dotty插件。

build.sbt
lazy val root = project
.in(file("."))
.settings(
name := "dottydemo",
version := "0.1",
scalaVersion := "0.13.0-RC1"
)plugins.sbt
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.3.0")此外,您还可以尝试IntelliJ IDEA (尽管它不受官方支持) 使用Intellij运行Scala项目
https://stackoverflow.com/questions/55079054
复制相似问题