Closed sbushmanov closed 2 years ago
Hey @sbushmanov thanks for the report.
scala.util.Properties.versionString -> : String = version 2.13.8
So this is a little bit of a gotcha. This doesn't actually correspond to the version of Scala that you're using, but rather the version of the collections library which is being used. In Scala 3, this is the 2.13 Scala collections library. For example, you can see this in the REPL even.
❯ scala3-nightly-repl
Downloading JVM index
Welcome to Scala 3.2.0-RC1-bin-20220308-29073f1-NIGHTLY-git-29073f1 (11.0.12, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> scala.util.Properties.versionString
val res0: String = version 2.13.8
So it's not a good idea to rely on that. So if your sbt build is using 3.1.1 as long as your worksheet is next to your sources you should be able to have your worksheet in 3.1.1 just fine.
Regarding about the warning about an invalid value for the fallbackScalaVersion
, that's due to this being out of date https://github.com/scalameta/coc-metals/blob/main/package.json#L271-L288. It hasn't been updated in a while. It should actually be updated to support the supported scala versions that are available. Feel free to shoot in a pr to update this.
Also, as a total aside, looking at your plugins, if you are only using coc-metals in the coc ecosystem, then I'd recommend switching to https://github.com/scalameta/nvim-metals. You can seed more context here: https://github.com/scalameta/coc-metals/issues/460
@ckipp01 Thanks, as always!
Working as Scala 3, indeed!
In a project with a `build.sbt' like
I'm running in a
*.worksheet.sc
:The following in metals config:
gives a warning:
even though specifying
3.0.0-M1
gives another warning this is not supported, and suggestion to upgrade to 3.1.1.I'm using:
and
It seems to me there must be a conflict between perhaps some leftover installation, but I am not able to troubleshoot it.
Any help how to use Scala 3.1.1 in a worksheet is appreciated
PS Same happens in VS (2.13.8) and in Intellij (2.13.6)