emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 33 forks source link

Scala 2.13.3 does not work with lsp-metals #33

Closed lightwave closed 4 years ago

lightwave commented 4 years ago

Describe the bug Scala 2.13.3 does not work with lsp-metals. Project with scalaVersion := "2.13.3" in build.sbt file fails the import step.

To Reproduce

  1. Install Courier & run cs setup. You should have scala 2.13.3 installed
  2. run sbt new scala/hello-world.g8 to create the hello world sample project
  3. In Emacs, open the hello-world-template directory you created above
  4. When asked to import the project, select import build
  5. After a few seconds, Metals Doctor would spit out errors recommending you to upgrade (downgrade) to 2.12.9 to make code navigation work. The exact error is Upgrade to Scala 2.12.9 and run 'Build import' to enable code navigation.

Expected behavior Expect code navigation to work for project with scala version 2.13.3

Screenshots MetalsError

Logs lsp-log buffer in emacs

Command "metals-emacs" is present on the path.
Command "metals-emacs" is present on the path.
Found the following clients for /Users/chris/git/scala/hello-world-template/src/main/scala/Main.scala: (server-id metals, priority -1)
The following clients were selected based on priority: (server-id metals, priority -1)
logging to file /Users/chris/git/scala/hello-world-template/.metals/metals.log
time: initialize in 1.13s
Creating watch for /Users/chris/git/scala/hello-world-template
Creating watch for /Users/chris/git/scala/hello-world-template/project
Creating watch for /Users/chris/git/scala/hello-world-template/src
Creating watch for /Users/chris/git/scala/hello-world-template/src/main
Creating watch for /Users/chris/git/scala/hello-world-template/src/main/scala
Creating watch for /Users/chris/git/scala/hello-world-template/src/test
running installed 'bloop bsp --protocol local --socket /var/folders/zj/qfh19vp902g5h7yc54x5v4zh0000gn/T/bsp4914067188148031495/19etob21zi0ri.socket'
skipping build import with status 'Installed'
tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /Users/chris/Library/Caches/org.scalameta.metals/bsp.trace.json
no build target: /Users/chris/git/scala/hello-world-template/src/main/scala/Main.scala
time: connected to build server in 0.48s
Creating watch for /Users/chris/git/scala/hello-world-template/src/main/scala-2.13
Creating watch for /Users/chris/git/scala/hello-world-template/src/main/java
Creating watch for /Users/chris/git/scala/hello-world-template/src/test/scala-2.13
Creating watch for /Users/chris/git/scala/hello-world-template/src/test/scala
Creating watch for /Users/chris/git/scala/hello-world-template/src/test/java
time: indexed workspace in 1.71s
unsupported Scala 2.13.3
unsupported Scala 2.13.3
kurnevsky commented 4 years ago

Looks like you use too old metals: https://scalameta.org/metals/blog/2020/07/01/lithium.html