Bog*_*nko 5 scala dotty visual-studio-code scala-3
我正在尝试使用Visual Studio Code来运行 dotty 代码。我开始使用IDEsbt launchIDE根据来自指令这个页面,我也安装Dotty Language Server和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
Run Code Online (Sandbox Code Playgroud)
(这是在https://dotty.epfl.ch/docs/usage/ide-support.html中提到的)。
该代码应该使用 scala运行(运行时是相同的)。如果代码是用 scalac 而不是 dotty编译的,这可能意味着 scalaVersion 错误build.sbt,或者 dotty sbt 插件未在plugins.sbt.
构建.sbt
lazy val root = project
.in(file("."))
.settings(
name := "dottydemo",
version := "0.1",
scalaVersion := "0.13.0-RC1"
)
Run Code Online (Sandbox Code Playgroud)
插件.sbt
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.3.0")
Run Code Online (Sandbox Code Playgroud)
您也可以尝试 IntelliJ IDEA (尽管它没有得到官方支持)使用 Intellij IDE 运行 Scala Dotty 项目