scalameta / metals-sublime

Sublime Text package for Metals, a language server for Scala
https://packagecontrol.io/packages/LSP-metals
Apache License 2.0
16 stars 10 forks source link

Metals Server v1.0 and beyond #116

Open mrubin opened 6 months ago

mrubin commented 6 months ago

I'm using LSP v1.27.0 and LSP-metals v0.17.6 in Sublime Text build 4169 on Mac OS Sonoma 14.1.1.

I'm seeing the following message: "You are using Scala version 2.13.12, which is not yet supported in this version of Metals. ..." Per https://scalameta.org/metals/blog/2023/07/19/silver, there is a line of Metals versions beyond 0.11.12 - there are versions 1.0 through 1.2. Are those versions not supported through Sublime? Is there a timeframe / ETA for supporting them?

Thank you

mrubin commented 6 months ago

Additionally, https://scalameta.org/metals/docs/editors/sublime/ states that Metals supports Scala 2.13.12.

mrubin commented 6 months ago

For whatever it's worth, the code at this diff does not appear to be working for me. I've uninstalled LSP / LSP-metals packages, restarted Sublime, and re-installed them from scratch.. and I would consistently get Metals Server 0.11.12 locally.

I'm including a screenshot of my LSP-metals settings. Previously, the "user" settings on the right were a blank/empty JSON object ({ }). With this configuration I consistently got Metals Server 0.11.12.

Looking at the above code diff, it looks like if the server_version is set to "latest-stable", it should make a GET request to https://scalameta.org/metals/latests.json and pull out the 'release' version. When I curl this url on my machine, I get the below:

$ curl https://scalameta.org/metals/latests.json
{
  "release": "1.2.0",
  "snapshot": "1.2.0+62-0ec94060-SNAPSHOT"
}

Once I changed the "user" settings of LSP-metals to:

{
  "server_version": "1.2.0",
}

it immediately installed the expected version. It seems to me that there's a bug here somewhere.

SublimeText_LSP_metals