scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.07k stars 323 forks source link

Cannot connect to metals-sublime using Sublime Text 3 #444

Closed velvia closed 5 years ago

velvia commented 5 years ago

I tried following the instructions here: https://scalameta.org/metals/docs/editors/sublime.html#known-issues

using metals 0.3.3 and Sublime Text 3.1.1 Build 3176. I was able to build metals-sublime and install LSP and configured it as stated. However when I do command-shift-P and "Enable Language Server in project", there is no option for "metals" and the metals server is not started. I have checked and double checked that I added an entry for metals in my LSP settings. In LSP.sublime-settings - User:

// Settings in here override those in "LSP/LSP.sublime-settings",

{
  "clients": {
    "metals": {
      "command": ["metals-sublime"],
      "enabled": true,
      "languageId": "scala",
      "scopes": ["source.scala"],
      "syntaxes": ["Packages/Scala/Scala.sublime-syntax"]
    }
  }
}

Anybody know how to proceed? Thanks.

ivanopagano commented 5 years ago

Did you check if the metals server binary was correctly added into your bin dir after installing with coursier?

Make sure the generated metals-sublime binary is available on your $PATH.

gabro commented 5 years ago

I had a similar issue, and what happened in my case was that metals was already activated but erroring due to the binary not being available in the PATH. Try using an absolute path, and see whether it fixes it

olafurpg commented 5 years ago

@velvia please reopen if it doesn't fix the problem to make "command": ["metals-sublime"] point to the absolute path of the binary.

velvia commented 5 years ago

@olafurpg thanks, but this did not resolve the issue. I put the absolute path in the command setting but it did not help. In any case the command was already in the path.
My problem is more that Sublime does not even show metals as a supported LSP thing. I can't even bring up metals as a valid option.

BTW I cannot reopen this issue.

olafurpg commented 5 years ago

I'm not sure how much we can do on the Metals side, this sounds like a Sublime LSP issue. @ayoub-benali any ideas what might be wrong?

ayoub-benali commented 5 years ago

Yes this seems to be an issue with the LSP plugin not related to Metals. I have the exact same configuration without any issue, @velvia try asking in the gitter channel for LSP plugin https://gitter.im/SublimeLSP/Lobby

olafurpg commented 5 years ago

Closing as I don't think we can do much on the Metals side.